Created
May 25, 2023 18:29
-
-
Save smoonlee/330561257e4cb45154afe47e9178580b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Code - Version Check | |
on: | |
workflow_dispatch | |
jobs: | |
Job: | |
name: Checkout code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get Package Version | |
id: package_version | |
run: | | |
package_name="github-docker" | |
response=$(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.PatToken }}" "https://api.github.com/user/packages/container/$package_name/versions" | jq '.[0]') | |
tag_version=$(echo "$response" | jq -r '.metadata.container.tags[0]') | |
echo "::set-output name=version::$tag_version" | |
- name: Display Package Version | |
run: | | |
echo "Latest version: ${{ steps.package_version.outputs.version }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment