Skip to content

Commit

Permalink
ci: parse dryrun output as json when using
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Oct 7, 2023
1 parent dcbb8e7 commit 8e04ff7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
meta:
runs-on: ubuntu-latest
outputs:
dryrun: ${{ fromJson(steps.dryrun.outputs.dryrun) }}
dryrun: ${{ steps.dryrun.outputs.dryrun }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
Expand All @@ -43,8 +43,11 @@ jobs:
else
dryrun=true
fi
echo "Dryrun: $dryrun"
echo "dryrun=$dryrun" >> $GITHUB_OUTPUT
- name: If Dryrun
if: ${{ fromJson(steps.dryrun.outputs.dryrun) }}
run: |
echo "Dryrun"
- name: Get Version
id: version
run: |
Expand Down Expand Up @@ -183,7 +186,7 @@ jobs:
done
- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ !needs.meta.outputs.dryrun }}
if: ${{ !fromJson(needs.meta.outputs.dryrun) }}
with:
name: v${{ needs.meta.outputs.version }}
generate_release_notes: true
Expand All @@ -201,4 +204,4 @@ jobs:
git diff version.json >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
git commit version.json -m "Update version.json"
git push --verbose ${{ needs.meta.outputs.dryrun && '--dry-run' || ''}}
git push --verbose ${{ fromJson(needs.meta.outputs.dryrun) && '--dry-run' || ''}}

0 comments on commit 8e04ff7

Please sign in to comment.