tools: edit commit-queue workflow file
PR-URL: https://github.com/nodejs/node/pull/58667 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
parent
bba07d7e1e
commit
efd28a0ca2
28
.github/workflows/commit-queue.yml
vendored
28
.github/workflows/commit-queue.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
# This action requires the following secrets to be set on the repository:
|
# This action requires the following secrets to be set on the repository:
|
||||||
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
|
|
||||||
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
|
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
|
||||||
|
# JENKINS_USER: GitHub user whose Jenkins token is defined below
|
||||||
# JENKINS_TOKEN: Jenkins token, to be used to check CI status
|
# JENKINS_TOKEN: Jenkins token, to be used to check CI status
|
||||||
|
|
||||||
name: Commit Queue
|
name: Commit Queue
|
||||||
@ -34,16 +34,16 @@ jobs:
|
|||||||
id: get_mergeable_prs
|
id: get_mergeable_prs
|
||||||
run: |
|
run: |
|
||||||
prs=$(gh pr list \
|
prs=$(gh pr list \
|
||||||
--repo ${{ github.repository }} \
|
--repo "$GITHUB_REPOSITORY" \
|
||||||
--base ${{ github.ref_name }} \
|
--base "$GITHUB_REF_NAME" \
|
||||||
--label 'commit-queue' \
|
--label 'commit-queue' \
|
||||||
--json 'number' \
|
--json 'number' \
|
||||||
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
|
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
|
||||||
-t '{{ range . }}{{ .number }} {{ end }}' \
|
-t '{{ range . }}{{ .number }} {{ end }}' \
|
||||||
--limit 100)
|
--limit 100)
|
||||||
fast_track_prs=$(gh pr list \
|
fast_track_prs=$(gh pr list \
|
||||||
--repo ${{ github.repository }} \
|
--repo "$GITHUB_REPOSITORY" \
|
||||||
--base ${{ github.ref_name }} \
|
--base "$GITHUB_REF_NAME" \
|
||||||
--label 'commit-queue' \
|
--label 'commit-queue' \
|
||||||
--label 'fast-track' \
|
--label 'fast-track' \
|
||||||
--search "-label:blocked" \
|
--search "-label:blocked" \
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
-t '{{ range . }}{{ .number }} {{ end }}' \
|
-t '{{ range . }}{{ .number }} {{ end }}' \
|
||||||
--limit 100)
|
--limit 100)
|
||||||
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
|
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
|
||||||
echo "numbers=$numbers" >> $GITHUB_OUTPUT
|
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
commitQueue:
|
commitQueue:
|
||||||
@ -61,9 +61,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
# Needs the whole git history for ncu to work
|
|
||||||
# See https://github.com/nodejs/node-core-utils/pull/486
|
|
||||||
fetch-depth: 0
|
|
||||||
# A personal token is required because pushing with GITHUB_TOKEN will
|
# A personal token is required because pushing with GITHUB_TOKEN will
|
||||||
# prevent commits from running CI after they land. It needs
|
# prevent commits from running CI after they land. It needs
|
||||||
# to be set here because `checkout` configures GitHub authentication
|
# to be set here because `checkout` configures GitHub authentication
|
||||||
@ -80,24 +77,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Set variables
|
- name: Set variables
|
||||||
run: |
|
run: |
|
||||||
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
|
echo "REPOSITORY=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)" >> "$GITHUB_ENV"
|
||||||
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Configure @node-core/utils
|
- name: Configure @node-core/utils
|
||||||
run: |
|
run: |
|
||||||
ncu-config set branch ${GITHUB_REF_NAME}
|
ncu-config set branch "${GITHUB_REF_NAME}"
|
||||||
ncu-config set upstream origin
|
ncu-config set upstream origin
|
||||||
ncu-config set username "$USERNAME"
|
ncu-config set username "$USERNAME"
|
||||||
ncu-config set token "$GH_TOKEN"
|
ncu-config set token "$GITHUB_TOKEN"
|
||||||
ncu-config set jenkins_token "$JENKINS_TOKEN"
|
ncu-config set jenkins_token "$JENKINS_TOKEN"
|
||||||
ncu-config set repo "${REPOSITORY}"
|
ncu-config set repo "${REPOSITORY}"
|
||||||
ncu-config set owner "${OWNER}"
|
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ secrets.JENKINS_USER }}
|
USERNAME: ${{ secrets.JENKINS_USER }}
|
||||||
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
||||||
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
|
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
|
||||||
|
|
||||||
- name: Start the Commit Queue
|
- name: Start the Commit Queue
|
||||||
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
|
run: ./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ needs.get_mergeable_prs.outputs.numbers }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user