Skip to content

gist-test

gist-test #1

Workflow file for this run

name: 'gist-test'
on:
workflow_dispatch:
jobs:
update-gist:
runs-on: ubuntu-latest
steps:
- name: Get latest release
id: get_latest_release
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.repos.getLatestRelease(context.repo);
return response.data.tag_name;
- name: Download latest.json
run: |
latest_release_tag=${{ steps.get_latest_release.outputs.result }}
release_info=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RELEASE_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${latest_release_tag}")
latest_json_url=$(echo "$release_info" | jq -r .tarball_url) # or use .zipball_url
curl -L "$latest_json_url" -o latest.json
- name: Update Gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.TOKEN }}
gist_id: ${{ secrets.GIST_ID }}
file_path: latest.json
file_type: text
gist_description: "Updater JSON for the latest release"
gist_file_name: "latest.json"