Skip to content

Commit d4b4d45

Browse files
committed
fix(release): pass -R to gh in the publish job
The job downloads artifacts but never checks the repository out, so gh could not tell which repository the release belonged to: failed to run git: fatal: not a git repository It failed right after the release was created, so the macOS install note, the cask upload and the tap push never ran. Pass -R "$GITHUB_REPOSITORY" to the three gh release calls instead of adding a checkout step.
1 parent 1d93e70 commit d4b4d45

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,11 @@ jobs:
382382
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
383383
run: |
384384
set -euo pipefail
385+
# -R, because this job never checks the repository out: gh has no
386+
# other way to know which repository the release lives in.
385387
note=$'\n\n> **macOS install**: the DMG is unsigned. After dragging `atvloadly.app` into Applications, run once:\n> `sudo xattr -dr com.apple.quarantine /Applications/atvloadly.app`'
386-
body="$(gh release view "$GITHUB_REF_NAME" --json body -q .body)"
387-
gh release edit "$GITHUB_REF_NAME" --notes "${body}${note}"
388+
body="$(gh release view "$GITHUB_REF_NAME" -R "$GITHUB_REPOSITORY" --json body -q .body)"
389+
gh release edit "$GITHUB_REF_NAME" -R "$GITHUB_REPOSITORY" --notes "${body}${note}"
388390
389391
# Cask generation needs the DMG's final checksum, so it runs after the
390392
# release step. The DMG upload already happened above; only the cask
@@ -455,7 +457,7 @@ jobs:
455457
- name: Upload cask to release
456458
env:
457459
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
458-
run: gh release upload "$GITHUB_REF_NAME" "${{ steps.cask.outputs.CASK_FILE }}" --clobber
460+
run: gh release upload "$GITHUB_REF_NAME" "${{ steps.cask.outputs.CASK_FILE }}" -R "$GITHUB_REPOSITORY" --clobber
459461

460462
- name: Push cask to Homebrew tap
461463
env:

0 commit comments

Comments
 (0)
⌂ 换网址