From df1b29cab417c6f4205cc11b2b132847ee5586b9 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 27 Apr 2021 17:47:30 -0700 Subject: [PATCH] meta: post comment when pr labeled fast-track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/38446 Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau Reviewed-By: Anto Aravinth Reviewed-By: Mary Marchini Reviewed-By: Trivikram Kamat --- .github/workflows/comment-labeled.yml | 29 +++++++++++++++++++++++++++ .github/workflows/comment-stalled.yml | 21 ------------------- 2 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/comment-labeled.yml delete mode 100644 .github/workflows/comment-stalled.yml diff --git a/.github/workflows/comment-labeled.yml b/.github/workflows/comment-labeled.yml new file mode 100644 index 00000000000000..14e48ea8dd37ca --- /dev/null +++ b/.github/workflows/comment-labeled.yml @@ -0,0 +1,29 @@ +name: Comment on issues and PRs when labelled +on: + issues: + types: [labeled] + pull_request_target: + types: [labeled] + +jobs: + staleComment: + 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 }} + 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." }' + + fastTrack: + if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track' + runs-on: ubuntu-latest + steps: + - 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." diff --git a/.github/workflows/comment-stalled.yml b/.github/workflows/comment-stalled.yml deleted file mode 100644 index 1c21505c4ad317..00000000000000 --- a/.github/workflows/comment-stalled.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Comment on issues and PRs when labelled stalled -on: - issues: - types: [labeled] - pull_request_target: - types: [labeled] - -jobs: - staleComment: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - name: Post comment - if: github.event.label.name == 'stalled' - env: - 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." }'