Skip to content

gist-test

gist-test #4

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 { owner, repo } = context.repo;
const response = await github.repos.listReleases({ owner, repo });
const latestTag = response.data
.filter(release => release.tag_name.startsWith('app-v'))
.map(release => release.tag_name)
.sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }))
.pop();
return latestTag;
- name: Download latest.json
run: |
latest_release_tag=${{ steps.get_latest_release.outputs.result }}
latest_json_url="https://github.com/acocalypso/dwarfii-stellarium-goto/releases/download/${latest_release_tag}/latest.json"
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"