Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/release-baseline-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'GenericMappingTools/pygmt'

permissions:
# To write assets to GitHub release
contents: write

steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -35,7 +39,6 @@ jobs:
shasum -a 256 baseline-images.zip

- name: Upload baseline image as a release asset
uses: shogo82148/[email protected]
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: baseline-images.zip
run: gh release upload ${{ github.ref_name }} baseline-images.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blog post you linked uses github.event.release.tag_name instead of github.ref_name. I had a look at https://docs.github.com/en/actions/learn-github-actions/contexts#github-context, and I suppose they're the same for tags (e.g. v0.12.0), but I suppose github.ref_name would be safer if we need to re-run the workflow, say if the dvc pull step failed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just triggered another run of the workflow in my own fork (https://github.com/seisman/pygmt/actions/runs/8772441014/job/24079741738).

  gh release upload v0.12.0 baseline-images.zip
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***

github.ref_name is v0.12.0 for the manually triggered run. I guess github.ref_name is better.

env:
GH_TOKEN: ${{ github.token }}