Skip to content

Commit 3cfac3b

Browse files
committed
fix: add gh token to curl api.github.com request
1 parent a87f82b commit 3cfac3b

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
run: bash ./scripts/check-existing-release.bash
3939
env:
4040
PKG_REL: ${{ steps.var.outputs.pkg_rel }}
41+
PKG_VERSION: ${{ steps.var.outputs.pkg_version }}
42+
TKN: ${{ secrets.GITHUB_TOKEN }}
4143

4244
artifact:
4345
runs-on: ubuntu-latest

.github/workflows/manual.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
run: bash ./scripts/check-existing-release.bash
4848
env:
4949
PKG_REL: ${{ steps.var.outputs.pkg_rel }}
50+
PKG_VERSION: ${{ steps.var.outputs.pkg_version }}
51+
TKN: ${{ secrets.GITHUB_TOKEN }}
5052

5153
artifact:
5254
runs-on: ubuntu-latest

scripts/check-existing-release.bash

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
set -euxo pipefail
44

5-
status_code=$(curl -s -o "/dev/null" -w "%{http_code}" "https://api.github.com/repos/mpsq/emacs-gcc-wayland-devel-builder/releases/tags/$NEW_COMMIT_N-$PKG_REL")
5+
status_code=$(curl \
6+
-s \
7+
-o "/dev/null" \
8+
-w "%{http_code}" \
9+
--header "authorization: Bearer $TKN" \
10+
"https://api.github.com/repos/mpsq/emacs-gcc-wayland-devel-builder/releases/tags/$PKG_VERSION-$PKG_REL")
611

712
if [[ "$status_code" == "200" ]]; then
813
exit 1
9-
fi
14+
fi

0 commit comments

Comments
 (0)