Skip to content

Commit

Permalink
meta: post comment when pr labeled fast-track
Browse files Browse the repository at this point in the history
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #38446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
jasnell authored and targos committed May 3, 2021
1 parent 7b9fb92 commit 96f54d3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/comment-labeled.yml
Original file line number Diff line number Diff line change
@@ -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."
21 changes: 0 additions & 21 deletions .github/workflows/comment-stalled.yml

This file was deleted.

0 comments on commit 96f54d3

Please sign in to comment.