Skip to content

Commit

Permalink
Update versions.json workflow fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xezard committed Nov 3, 2024
1 parent 38863b1 commit 7ab888e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
TAG_NAME=${{ github.ref }}
TAG_NAME=${TAG_NAME#refs/tags/}
if ! grep -q "\"$TAG_NAME\":" versions.json; then
LAST_VERSION=$(jq 'keys | .[-1]' versions.json)
jq --arg tag "$TAG_NAME" --arg last "$LAST_VERSION" '.[$tag] = $last' versions.json > tmp.json && mv tmp.json versions.json
LAST_VERSION=$(jq -r 'keys | .[-1]' versions.json)
PREVIOUS_VERSION=$(jq -r ".\"$LAST_VERSION\"" versions.json)
jq --arg tag "$TAG_NAME" --arg last "$PREVIOUS_VERSION" '.[$tag] = $last' versions.json > tmp.json && mv tmp.json versions.json
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add versions.json
Expand Down

0 comments on commit 7ab888e

Please sign in to comment.