From d3419ae9b2cc74b230701754d8e9e398d8dffecb Mon Sep 17 00:00:00 2001 From: Mestery Date: Fri, 26 Nov 2021 22:41:58 +0100 Subject: [PATCH] build: improve readability of texts in workflows --- .github/workflows/authors.yml | 5 ++++- .github/workflows/close-stalled.yml | 10 ++++++++-- .github/workflows/comment-labeled.yml | 10 ++++++++-- .github/workflows/license-builder.yml | 5 ++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/authors.yml b/.github/workflows/authors.yml index 40d68d9af08d37..0a14c94f1d7e74 100644 --- a/.github/workflows/authors.yml +++ b/.github/workflows/authors.yml @@ -21,7 +21,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} with: author: Node.js GitHub Bot - body: "Here are some new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js`." + body: > + Here are some new additions to the AUTHORS file. + This is an automatically generated PR by the + `authors.yml` GitHub Action, which runs `tools/update-authors.js`. branch: "actions/authors-update" # Custom branch *just* for this Action. commit-message: "meta: update AUTHORS" labels: meta diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 1b2fc2b7a6fd7e..9a3dad5621b971 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -3,6 +3,12 @@ on: schedule: - cron: "0 0 * * *" +env: + CLOSE_MESSAGE: > + Closing this because it has stalled. Feel free to reopen if this issue/PR + is still relevant, or to ping the collaborator who labelled it stalled if + you have any questions. + jobs: stale: if: github.repository == 'nodejs/node' @@ -14,8 +20,8 @@ jobs: 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 69314e75121f70..2b70802d9adbf4 100644 --- a/.github/workflows/comment-labeled.yml +++ b/.github/workflows/comment-labeled.yml @@ -5,6 +5,12 @@ on: 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: if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled' @@ -14,7 +20,7 @@ jobs: env: NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh issue comment "$NUMBER" --repo ${{ github.repository }} --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." + run: gh issue comment "$NUMBER" --repo ${{ github.repository }} --body "$STALE_MESSAGE" fastTrack: if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track' @@ -23,4 +29,4 @@ jobs: - name: Request Fast-Track 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." + run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$FAST_TRACK_MESSAGE" diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml index b959eb8932285b..0f83e16194b37f 100644 --- a/.github/workflows/license-builder.yml +++ b/.github/workflows/license-builder.yml @@ -22,6 +22,9 @@ jobs: author: Node.js GitHub Bot branch: actions/license-builder 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." + 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. commit-message: 'doc: run license-builder' labels: meta