diff --git a/.github/workflows/authors.yml b/.github/workflows/authors.yml index 1f410a727abd42..c3b122ff750c35 100644 --- a/.github/workflows/authors.yml +++ b/.github/workflows/authors.yml @@ -1,6 +1,5 @@ -name: "authors update" -on: - workflow_dispatch: +name: authors update +on: workflow_dispatch jobs: authors_update: @@ -8,15 +7,22 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: '0' # this is required to actually get all the authors - - run: "tools/update-authors.js" # run the AUTHORS tool + fetch-depth: 0 # this is required to actually get all the authors + - run: tools/update-authors.js # run the AUTHORS tool - uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - title: "meta: update AUTHORS" - body: "If this PR exists, there's presumably new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.\n\nPlease note that there might be duplicate entries. If there are, please remove them and add the duplicate emails to .mailmap directly to this PR." - branch: "actions/authors-update" # custom branch *just* for this Action. - commit-message: "meta: update AUTHORS" + title: 'meta: update AUTHORS' + commit-message: 'meta: update AUTHORS' author: github-actions[bot] + body: > + If this PR exists, there's presumably new additions to the AUTHORS file. + This is an automatically generated PR by the `authors.yml` GitHub Action, + which runs `tools/update-authors.js` and submits a new PR or updates an existing PR. + + + Please note that there might be duplicate entries. If there are, please remove them and + add the duplicate emails to .mailmap directly to this PR. + branch: actions/authors-update # custom branch *just* for this Action. labels: meta diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml index c3527549e16af4..57e6cd9d23c8fe 100644 --- a/.github/workflows/auto-start-ci.yml +++ b/.github/workflows/auto-start-ci.yml @@ -1,4 +1,3 @@ ---- name: Auto Start CI on: @@ -7,23 +6,23 @@ on: # optimistic, it can take longer to run. # To understand why `schedule` is used instead of other events, refer to # ./doc/guides/commit-queue.md - - cron: "*/5 * * * *" + - cron: '*/5 * * * *' env: NODE_VERSION: lts/* jobs: - startCI: + start-ci: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install dependencies - name: Install Node.js uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} + - name: Install node-core-utils run: npm install -g node-core-utils @@ -32,26 +31,6 @@ jobs: echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV - # Get Pull Requests - - name: Get Pull Requests - uses: octokit/graphql-action@v2.x - id: get_prs_for_ci - with: - query: | - query prs($owner:String!, $repo:String!) { - repository(owner:$owner, name:$repo) { - pullRequests(labels: ["request-ci"], states: OPEN, last: 100) { - nodes { - number - } - } - } - } - owner: ${{ env.OWNER }} - repo: ${{ env.REPOSITORY }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup node-core-utils run: | ncu-config set username ${{ secrets.JENKINS_USER }} @@ -60,5 +39,9 @@ jobs: ncu-config set owner ${{ env.OWNER }} ncu-config set repo ${{ env.REPOSITORY }} - - name: Start CI - run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') + - name: Get Pull Requests and start CI + run: | + prs=`gh pr list --repo ${{ github.repository }} --limit 100 --json number -q 'map(.number) | .[]'` + ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $prs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 37f4e707561606..3bf75a1216adf2 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -4,20 +4,15 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review] push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, 'v[0-9]+.x-staging', 'v[0-9]+.x'] env: FLAKY_TESTS: dontcare + PYTHON_VERSION: 3.9 jobs: build-tarball: if: github.event.pull_request.draft == false - env: - PYTHON_VERSION: 3.9 runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -36,13 +31,11 @@ jobs: mkdir tarballs mv *.tar.gz tarballs - name: Upload tarball artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: tarballs path: tarballs test-tarball-linux: - env: - PYTHON_VERSION: 3.9 needs: build-tarball runs-on: ubuntu-latest steps: @@ -54,9 +47,10 @@ jobs: - name: Environment Information run: npx envinfo - name: Download tarball - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v2 with: name: tarballs + path: tarballs - name: Extract tarball run: | tar xzf tarballs/*.tar.gz -C $RUNNER_TEMP diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 1b0b336f4b8273..21055be57c136d 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -3,13 +3,22 @@ name: build-windows on: pull_request: types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '**.md' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/build-windows.yml' push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, canary, 'v[0-9]+.x-staging', 'v[0-9]+.x'] + paths-ignore: + - '**.md' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/build-windows.yml' env: PYTHON_VERSION: 3.9 diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 916baf0463fa6c..3aad258d0ad97b 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -1,21 +1,26 @@ name: Close stalled issues and PRs on: schedule: - - cron: "0 0 * * *" + - cron: 0 0 * * * + +env: + CLOSE_MESSAGE: > + Closing this because it has stalled. Feel free to reopen if this issue is still relevant, + or to ping the collaborator who labelled it stalled if you have any questions. jobs: stale: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-close: 30 stale-pr-label: stalled stale-issue-label: stalled - close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. - close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. + close-issue-message: ${{ env.CLOSE_MESSAGE }} + close-pr-message: ${{ env.CLOSE_MESSAGE }} # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues only-labels: stalled # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits diff --git a/.github/workflows/comment-labeled.yml b/.github/workflows/comment-labeled.yml index 14e48ea8dd37ca..21d3f25faa54b1 100644 --- a/.github/workflows/comment-labeled.yml +++ b/.github/workflows/comment-labeled.yml @@ -1,29 +1,35 @@ -name: Comment on issues and PRs when labelled +name: Comment on issues and PRs when labeled on: issues: types: [labeled] pull_request_target: types: [labeled] +env: + STALE_MESSAGE: >- + This issue/PR was marked as stalled, it will be automatically closed in 30 days. + If it should remain open, please leave a comment explaining why it should remain open. + FAST_TRACK_MESSAGE: Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve. + jobs: - staleComment: + stale-comment: if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled' runs-on: ubuntu-latest steps: - name: Post stalled comment env: - COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} + COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} run: | curl -X POST $COMMENTS_URL \ -H "Content-Type: application/json" \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - --data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }' + --data "{ \"body\": \"$STALE_MESSAGE\" }" - fastTrack: - if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track' + fast-track: + if: github.repository == 'nodejs/node' && github.event.issue.pull_request && github.event.label.name == 'fast-track' runs-on: ubuntu-latest steps: - name: Request Fast-Track + run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$FAST_TRACK_MESSAGE" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve." diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 0f6fd639523cb0..a11507935f8d47 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -1,4 +1,4 @@ -name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q" +name: Commit messages adheres to guidelines at https://goo.gl/p2fr5Q on: [pull_request] diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml index 9b8e99c98e5582..ff9f94fd943dd9 100644 --- a/.github/workflows/commit-queue.yml +++ b/.github/workflows/commit-queue.yml @@ -1,4 +1,3 @@ ---- # 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 @@ -12,7 +11,7 @@ on: # be read-only, and the Action won't have access to any other repository # secrets, which it needs to access Jenkins API. schedule: - - cron: "*/5 * * * *" + - cron: '*/5 * * * *' env: NODE_VERSION: lts/* @@ -33,11 +32,11 @@ jobs: # for push as well. token: ${{ secrets.GH_USER_TOKEN }} - # Install dependencies - name: Install Node.js uses: actions/setup-node@v2 with: node-version: ${{ env.NODE_VERSION }} + - name: Install node-core-utils run: npm install -g node-core-utils@latest @@ -47,27 +46,6 @@ jobs: echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - - name: Get Pull Requests - uses: octokit/graphql-action@v2.x - id: get_mergable_pull_requests - with: - query: | - query release($owner:String!,$repo:String!, $base_ref:String!) { - repository(owner:$owner, name:$repo) { - pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) { - nodes { - number - } - } - } - } - owner: ${{ env.OWNER }} - repo: ${{ env.REPOSITORY }} - # Commit queue is only enabled for the default branch on the repository - base_ref: ${{ env.DEFAULT_BRANCH }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Configure node-core-utils run: | ncu-config set branch ${DEFAULT_BRANCH} @@ -78,5 +56,10 @@ jobs: ncu-config set repo "${REPOSITORY}" ncu-config set owner "${OWNER}" - - name: Start the commit queue - run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') + # Commit queue is only enabled for the default branch on the repository. + - name: Get Pull Requests and start the commit queue + run: | + prs=`gh pr list --repo ${{ github.repository }} --base ${{ env.DEFAULT_BRANCH }} --limit 100 --json number -q 'map(.number) | .[]'` + ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $prs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 2ee6c8b5f19b77..f544cb84e095d6 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -5,18 +5,25 @@ on: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - '**.md' - - 'benchmark/**' - - 'deps/**' - - 'doc/**' + - benchmark/** + - deps/** + - doc/**, + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/coverage-linux.yml' push: - branches: - - master - - main + branches: [master, main] paths-ignore: - '**.md' - - 'benchmark/**' - - 'deps/**' - - 'doc/**' + - benchmark/** + - deps/** + - doc/** + - 'tools/**' + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/coverage-linux.yml' env: PYTHON_VERSION: 3.9 diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 0f0072bfe6c532..c9426bbb2441bb 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -9,16 +9,22 @@ on: - 'deps/**' - 'doc/**' - 'tools/**' + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/coverage-windows.yml' push: - branches: - - master - - main + branches: [master, main] paths-ignore: - '**.md' - 'benchmark/**' - 'deps/**' - 'doc/**' - 'tools/**' + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/coverage-windows.yml' env: PYTHON_VERSION: 3.9 diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index e36a3fb5194125..c91289bb0a776a 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -3,7 +3,7 @@ name: Node.js daily job on: workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: 0 0 * * * env: NODE_VERSION: lts/* diff --git a/.github/workflows/misc.yml b/.github/workflows/doc.yml similarity index 82% rename from .github/workflows/misc.yml rename to .github/workflows/doc.yml index 64f58f2e96f448..8bab908f623f7f 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/doc.yml @@ -1,14 +1,10 @@ -name: misc +name: Test and upload documentation to artifacts on: pull_request: types: [opened, synchronize, reopened, ready_for_review] push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, 'v[0-9]+.x-staging', 'v[0-9]+.x'] env: NODE_VERSION: lts/* @@ -27,7 +23,7 @@ jobs: run: npx envinfo - name: Build run: NODE=$(command -v node) make doc-only - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v2 with: name: docs path: out/doc diff --git a/.github/workflows/find-inactive-collaborators.yml b/.github/workflows/find-inactive-collaborators.yml index fbb392d2e537ef..b305f5ec242b68 100644 --- a/.github/workflows/find-inactive-collaborators.yml +++ b/.github/workflows/find-inactive-collaborators.yml @@ -1,19 +1,17 @@ name: Find inactive collaborators on: + workflow_dispatch: schedule: # Run on the 15th day of the month at 4:05 AM UTC. - - cron: '5 4 15 * *' - - workflow_dispatch: + - cron: 5 4 15 * * env: - NODE_VERSION: 16.x + NODE_VERSION: 16 NUM_COMMITS: 5000 jobs: find: - runs-on: ubuntu-latest steps: @@ -34,8 +32,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + title: 'meta: move one or more collaborators to emeritus' + commit-message: 'meta: move one or more collaborators to emeritus' author: github-actions[bot] body: This PR was generated by tools/find-inactive-collaborators.yml. - commit-message: "meta: move one or more collaborators to emeritus" labels: meta - title: "meta: move one or more collaborators to emeritus" diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml index 115bef9977d9d5..69189e5f7f14db 100644 --- a/.github/workflows/license-builder.yml +++ b/.github/workflows/license-builder.yml @@ -1,10 +1,10 @@ name: license update on: + workflow_dispatch: schedule: # 00:00:00 every Monday # https://crontab.guru/#0_0_*_*_1 - - cron: "0 0 * * 1" - workflow_dispatch: + - cron: 0 0 * * 1 jobs: update_license: @@ -12,12 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: "./tools/license-builder.sh" # run the license builder tool - - uses: gr2m/create-or-update-pull-request-action@v1.x # create a PR or update the Action's existing PR + - run: ./tools/license-builder.sh # run the license builder tool + - uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - title: "doc: run license-builder" - body: "License is likely out of date. This is an automatically generated PR by the `license-builder.yml` GitHub Action, which runs `license-builder.sh` and submits a new PR or updates an existing PR." + title: 'doc: run license-builder' commit-message: 'doc: run license-builder' + body: > + License is likely out of date. This is an automatically generated PR by + the `license-builder.yml` GitHub Action, which runs `license-builder.sh` + and submits a new PR or updates an existing PR. labels: meta diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 987a38e56165fe..ca04bff366ca7a 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -3,12 +3,10 @@ name: linters on: pull_request: types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: [AUTHORS, .mailmap] push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, 'v[0-9]+.x-staging', 'v[0-9]+.x'] + paths-ignore: [AUTHORS, .mailmap] env: PYTHON_VERSION: 3.9 @@ -93,7 +91,7 @@ jobs: NODE=$(command -v node) make lint-py lint-sh: if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: shellcheck -V @@ -104,9 +102,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: mszostok/codeowners-validator@v0.4.0 + - uses: mszostok/codeowners-validator@v0.6.0 with: - checks: "files,duppatterns" + checks: files,duppatterns lint-pr-url: if: ${{ github.event.pull_request }} runs-on: ubuntu-latest diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml index e3bdc0353c60fb..ea744102903acc 100644 --- a/.github/workflows/notify-force-push.yml +++ b/.github/workflows/notify-force-push.yml @@ -1,8 +1,6 @@ on: push: - branches: - - master - - main + branches: [master, main] name: Notify on Force Push jobs: @@ -16,7 +14,7 @@ jobs: env: SLACK_COLOR: '#DE512A' SLACK_ICON: https://github.com/nodejs.png?size=48 - SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}' + SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }} SLACK_MESSAGE: | A commit was force-pushed to by diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 2762a08fa10bc8..b445d1febfb9fd 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -2,20 +2,23 @@ name: test-asan on: push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, canary, 'v[0-9]+.x-staging', 'v[0-9]+.x'] paths-ignore: - '**.md' - - 'doc/**' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-asan.yml' pull_request: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - '**.md' - - 'doc/**' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-asan.yml' env: PYTHON_VERSION: 3.9 diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 07e871bd07dc02..02ecbe3131fb23 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -3,13 +3,18 @@ name: test-linux on: pull_request: types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-linux.yml' push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, canary, 'v[0-9]+.x-staging', 'v[0-9]+.x'] + paths-ignore: + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-linux.yml' env: PYTHON_VERSION: 3.9 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index adcacc9b99187c..82bccf2dbdf4b8 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -5,17 +5,20 @@ on: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - '**.md' - - 'doc/**' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-macos.yml' push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x + branches: [master, main, canary, 'v[0-9]+.x-staging', 'v[0-9]+.x'] paths-ignore: - '**.md' - - 'doc/**' + - doc/** + - AUTHORS + - .mailmap + - .github/** + - '!.github/workflows/test-macos.yml' env: PYTHON_VERSION: 3.9