Skip to content

Commit

Permalink
ci: Fix version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
IanTapply22 committed May 25, 2024
1 parent bccc0db commit 17c550f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ jobs:
id: compare_versions
run: |
PUBLISHED_VERSION=$(curl -s \
-u ${{ secrets.GITHUB_USERNAME }}:${{ secrets.GITHUB_TOKEN }} \
-H "Accept: application/vnd.github.v3+json" \
https://github.com/IanTapply22/Wynncraft/packages/2160010?version=${{needs.version.outputs.version}})
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/IanTapply22/packages/maven/wynncraft/versions | jq '[.[] ] | .[0] .metadata .container .tags[0]')
if [[ "$PUBLISHED_VERSION" == *"${{needs.version.outputs.version}}"* ]]; then
echo "Version is already published. Skipping publish step."
echo "::set-output name=skip::true"
Expand Down

0 comments on commit 17c550f

Please sign in to comment.