Skip to content

Commit 500b52a

Browse files
authored
Merge pull request #13 from ClipABit/target-tag-fix
Target tag auth permissions fix
2 parents d4b914f + 228fb5e commit 500b52a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/build-installers.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ jobs:
2323

2424
- name: Pull Resolve-Plugin repository (latest release)
2525
env:
26+
GITHUB_TOKEN: ${{ github.token }}
2627
DISPATCH_TAG: ${{ github.event.client_payload.release_tag }}
2728
INPUT_TAG: ${{ github.event.inputs.resolve_plugin_tag }}
2829
run: |
2930
TARGET_TAG="${DISPATCH_TAG:-${INPUT_TAG:-}}"
3031
if [ -z "$TARGET_TAG" ]; then
31-
TARGET_TAG=$(curl --fail -s https://api.github.com/repos/ClipABit/Resolve-Plugin/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
32+
TARGET_TAG=$(curl --fail --silent --show-error --retry 3 --retry-delay 2 \
33+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
34+
-H "Accept: application/vnd.github+json" \
35+
https://api.github.com/repos/ClipABit/Resolve-Plugin/releases/latest \
36+
| python3 -c 'import json,sys; print((json.load(sys.stdin) or {}).get("tag_name", ""))')
3237
if [ -z "$TARGET_TAG" ]; then
3338
echo "ERROR: Failed to fetch latest release tag from GitHub API"
3439
exit 1

0 commit comments

Comments
 (0)