Skip to content

Commit 149626b

Browse files
committed
CI: switch to PAT token (CI token expires once job is done)
1 parent 185ed9a commit 149626b

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

.github/workflows/start-gitlab.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
# It also grants access to secrets needed for the trigger.
66
pull_request_target:
77
types: [opened, synchronize, reopened]
8-
# Allow the GITHUB_TOKEN passed on to Gitlab to update the commit status.
9-
permissions:
10-
statuses: write
118
jobs:
129
trigger-gitlab:
1310
runs-on: ubuntu-latest
@@ -52,6 +49,5 @@ jobs:
5249
--form "variables[GITHUB_PR_SHA]=${GITHUB_PR_SHA}" \
5350
--form "variables[GITHUB_PR_REF]=${GITHUB_PR_REF}" \
5451
--form "variables[GITHUB_REPO]=${GITHUB_REPO}" \
55-
--form "variables[GITHUB_TOKEN]=${GITHUB_TOKEN}" \
5652
"${GL_TRIGGER_URL}" > /dev/null
5753
echo "GitLab pipeline triggered."

gitlab/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ report_github_status:
77
# Only run this job if:
88
# 1. The pipeline was started by an API trigger (`CI_PIPELINE_SOURCE == "trigger"`)
99
# 2. The required variables from GitHub Actions are present.
10-
- if: '$CI_PIPELINE_SOURCE == "trigger" && $GITHUB_PR_SHA && $GITHUB_TOKEN && $GITHUB_REPO && $GITHUB_PR_REF'
10+
- if: '$CI_PIPELINE_SOURCE == "trigger" && $GITHUB_PR_SHA && $GH_STATUS_TOKEN && $GITHUB_REPO && $GITHUB_PR_REF'
1111
before_script:
1212
# Make sure curl and git are available
1313
- apk add --no-cache curl git
@@ -16,7 +16,7 @@ report_github_status:
1616
echo "Reporting pending status to GitHub commit $GITHUB_PR_SHA"
1717
true || curl --fail --request POST \
1818
--url "https://api.github.com/repos/${GITHUB_REPO}/statuses/${GITHUB_PR_SHA}" \
19-
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
19+
--header "Authorization: Bearer ${GH_STATUS_TOKEN}" \
2020
--header "Accept: application/vnd.github.v3+json" \
2121
--header "Content-Type: application/json" \
2222
--data @- <<EOF
@@ -27,7 +27,7 @@ report_github_status:
2727
"context": "ci/gitlab/pipeline-status"
2828
}
2929
EOF
30-
- >
30+
- |
3131
docker buildx create \
3232
--driver=docker-container \
3333
--name=buildkit-builder \
@@ -37,7 +37,7 @@ report_github_status:
3737
- git clone -b "$GITHUB_PR_REF" https://github.com/blockstream/esplora.git .
3838
- cd esplora
3939
- docker pull "${IMAGE_BASE}:latest-${ARCH}" || true
40-
- >
40+
- |
4141
docker buildx build \
4242
--push \
4343
--platform "linux/${ARCH}" \
@@ -61,7 +61,7 @@ report_github_status:
6161
echo "Reporting $FINAL_STATE status to GitHub commit $GITHUB_PR_SHA"
6262
true || curl --fail --request POST \
6363
--url "https://api.github.com/repos/${GITHUB_REPO}/statuses/${GITHUB_PR_SHA}" \
64-
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
64+
--header "Authorization: Bearer ${GH_STATUS_TOKEN}" \
6565
--header "Accept: application/vnd.github.v3+json" \
6666
--header "Content-Type: application/json" \
6767
--data @- << EOF

0 commit comments

Comments
 (0)