Skip to content

Commit 2b7766e

Browse files
authored
tools: use the read-only token when filtering PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65169 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent 8f51878 commit 2b7766e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/commit-queue.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
commitQueue:
5959
needs: get_candidate_prs
6060
if: needs.get_candidate_prs.outputs.candidates != ''
61+
permissions:
62+
pull-requests: read
6163
runs-on: ubuntu-slim
6264
steps:
6365
# Install dependencies
@@ -78,13 +80,13 @@ jobs:
7880
ncu-config --global set branch "${GITHUB_REF_NAME}"
7981
ncu-config --global set upstream origin
8082
ncu-config --global set username "$USERNAME"
81-
ncu-config --global set token "$GITHUB_TOKEN"
83+
ncu-config --global set token "$GH_TOKEN"
8284
ncu-config --global set jenkins_token "$JENKINS_TOKEN"
8385
ncu-config --global set repo "${REPOSITORY}"
8486
ncu-config --global set owner "${GITHUB_REPOSITORY_OWNER}"
8587
env:
8688
USERNAME: ${{ secrets.JENKINS_USER }}
87-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
89+
GH_TOKEN: ${{ github.token }}
8890
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
8991

9092
- name: Filter Pull Requests
@@ -154,7 +156,7 @@ jobs:
154156
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
155157
env:
156158
CANDIDATES: ${{ needs.get_candidate_prs.outputs.candidates }}
157-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
159+
GH_TOKEN: ${{ github.token }}
158160

159161
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
160162
if: steps.get_mergeable_prs.outputs.numbers != ''
@@ -167,6 +169,8 @@ jobs:
167169

168170
- name: Start the Commit Queue
169171
if: steps.get_mergeable_prs.outputs.numbers != ''
170-
run: ./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ steps.get_mergeable_prs.outputs.numbers }}
172+
run: |
173+
ncu-config set token "$GH_TOKEN"
174+
./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ steps.get_mergeable_prs.outputs.numbers }}
171175
env:
172-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
176+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}

0 commit comments

Comments
 (0)