Use GitHub CLI to fetch release information (#92)

This commit is contained in:
Adriano Orioli
2022-08-07 07:18:03 +02:00
committed by GitHub
parent 651e66176a
commit d5d59bbe53

View File

@@ -11,19 +11,12 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
outputs: outputs:
release_tag: ${{ steps.parse.outputs.tag }} release_tag: ${{ steps.parse.outputs.tag }}
json: ${{ steps.get_latest_release.outputs.data }} steps:
steps:
- uses: octokit/request-action@v2.x
id: get_latest_release
with:
route: GET /repos/godotengine/godot/releases/latest
owner: octokit
repo: request-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: parse - id: parse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
TAG=$(echo '${{ steps.get_latest_release.outputs.data }}' | jq --raw-output .tag_name) TAG=$(gh release view --repo godotengine/godot --json tagName --jq .tagName)
echo "::set-output name=tag::$TAG" echo "::set-output name=tag::$TAG"
current: current:
name: Fetch Current Godot CI release name: Fetch Current Godot CI release
@@ -43,7 +36,9 @@ jobs:
if: needs.fetch.outputs.release_tag != needs.current.outputs.release_tag if: needs.fetch.outputs.release_tag != needs.current.outputs.release_tag
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: echo '${{ needs.fetch.outputs.json }}' | jq --raw-output .body | sed 's/\\r\\n/\n/g' > body.txt - run: gh release view --repo godotengine/godot --json body --jq .body | sed 's/\\r\\n/\n/g' > body.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: | - run: |
git config user.name github-actions git config user.name github-actions
git config user.email github-actions@github.com git config user.email github-actions@github.com