From 0bdb996c30f3b220940d59b6b49ce191f527c545 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 1 Apr 2025 15:31:24 -0500 Subject: [PATCH 1/3] tools: use github cli to squash the pr PR-URL: https://github.com/nodejs/node/pull/57675 Reviewed-By: Luigi Pinca --- tools/actions/commit-queue.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 3b3138053cb..1f2daf2fd26 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -82,18 +82,11 @@ for pr in "$@"; do fi else # If there's only one commit, we can use the Squash and Merge feature from GitHub. - # TODO: use `gh pr merge` when the GitHub CLI allows to customize the commit title (https://github.com/cli/cli/issues/1023). commit_title=$(git log -1 --pretty='format:%s') commit_body=$(git log -1 --pretty='format:%b') commit_head=$(grep 'Fetched commits as' output | cut -d. -f3 | xargs git rev-parse) - jq -n \ - --arg title "${commit_title}" \ - --arg body "${commit_body}" \ - --arg head "${commit_head}" \ - '{merge_method:"squash",commit_title:$title,commit_message:$body,sha:$head}' > output.json - cat output.json - if ! gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input output.json > output; then + if ! gh pr merge "$pr" --squash --body "$commit_body" --subject "$commit_title" --match-head-commit "$commit_head" > output; then commit_queue_failed "$pr" continue fi @@ -102,7 +95,6 @@ for pr in "$@"; do commit_queue_failed "$pr" continue fi - rm output.json fi rm output From a3c9847e0d49fdfe351907098f8bb59b7934b1d1 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 5 Apr 2025 14:16:46 +0200 Subject: [PATCH 2/3] tools: update repo name for CQ PR-URL: https://github.com/nodejs/node/pull/57675 Reviewed-By: Luigi Pinca --- .github/workflows/commit-queue.yml | 11 +++++++---- tools/actions/commit-queue.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml index 556843635dd..071cf79a0a5 100644 --- a/.github/workflows/commit-queue.yml +++ b/.github/workflows/commit-queue.yml @@ -25,7 +25,7 @@ jobs: get_mergeable_prs: permissions: pull-requests: read - if: github.repository == 'nodejs/node' + if: github.repository == 'nodejs/node-auto-test' runs-on: ubuntu-latest outputs: numbers: ${{ steps.get_mergeable_prs.outputs.numbers }} @@ -55,6 +55,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} commitQueue: + permissions: + contents: write + pull-requests: write needs: get_mergeable_prs if: needs.get_mergeable_prs.outputs.numbers != '' runs-on: ubuntu-latest @@ -68,7 +71,7 @@ jobs: # prevent commits from running CI after they land. It needs # to be set here because `checkout` configures GitHub authentication # for push as well. - token: ${{ secrets.GH_USER_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # Install dependencies - name: Install Node.js @@ -94,10 +97,10 @@ jobs: ncu-config set owner "${OWNER}" env: USERNAME: ${{ secrets.JENKINS_USER }} - GH_TOKEN: ${{ secrets.GH_USER_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }} - name: Start the Commit Queue run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }} env: - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 1f2daf2fd26..22b9531aad9 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -86,7 +86,7 @@ for pr in "$@"; do commit_body=$(git log -1 --pretty='format:%b') commit_head=$(grep 'Fetched commits as' output | cut -d. -f3 | xargs git rev-parse) - if ! gh pr merge "$pr" --squash --body "$commit_body" --subject "$commit_title" --match-head-commit "$commit_head" > output; then + if ! gh pr merge "$pr" --squash --body "$commit_body" --subject "$commit_title" --match-head-commit "$commit_head" --admin > output; then commit_queue_failed "$pr" continue fi From 216f537d19eb9aa17d2450b72743291ec1a75944 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 16:36:44 +0000 Subject: [PATCH 3/3] meta: bump actions/setup-python from 5.5.0 to 5.6.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/8d9ed9ac5c53483de85588cdf95a591a75ab9f55...a26af69be951a213d495a4c3e4e4022e16d87065) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 5.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-tarball.yml | 4 ++-- .github/workflows/coverage-linux-without-intl.yml | 2 +- .github/workflows/coverage-linux.yml | 2 +- .github/workflows/coverage-windows.yml | 2 +- .github/workflows/daily-wpt-fyi.yml | 2 +- .github/workflows/linters.yml | 8 ++++---- .github/workflows/test-internet.yml | 2 +- .github/workflows/test-linux.yml | 2 +- .github/workflows/test-macos.yml | 2 +- .github/workflows/tools.yml | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index a784b43cfc6..5fae318569f 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -46,7 +46,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up sccache @@ -76,7 +76,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up sccache diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index a1f8f060dda..9cefdcff875 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -52,7 +52,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up sccache diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 9305d5f02ca..bab1d81ed06 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -52,7 +52,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up sccache diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 0ada43321eb..7ba90f1dfea 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -49,7 +49,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install deps diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml index f8664adb1eb..db358bfe04b 100644 --- a/.github/workflows/daily-wpt-fyi.yml +++ b/.github/workflows/daily-wpt-fyi.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 1a97aeec9fe..a56c279cfce 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -44,7 +44,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -64,7 +64,7 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -122,7 +122,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -139,7 +139,7 @@ jobs: with: persist-credentials: false - name: Use Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 64229dcffc6..7d25113c024 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -48,7 +48,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 2266d0da067..ea4a6a138e2 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -46,7 +46,7 @@ jobs: persist-credentials: false path: node - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up sccache diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 53329afd930..c74e200acb0 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -52,7 +52,7 @@ jobs: persist-credentials: false path: node - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up Xcode ${{ env.XCODE_VERSION }} diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index a620aa72a65..a04847e05a3 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -294,7 +294,7 @@ jobs: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} if: matrix.id == 'icu' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} - run: ${{ matrix.run }}