Test issue #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify triage | |
on: | |
workflow_call: | |
issues: | |
types: [opened] | |
pull_request_target: | |
types: [opened] | |
# Perms come from the token. | |
permissions: {} | |
jobs: | |
notify: | |
# Exclude dependabot's dependency updates. That's just going to annoy people. | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Run workflow | |
env: | |
GH_TOKEN: ${{ secrets.ISSUE_PR_PROJECTS_TOKEN }} | |
ISSUE_PR_NUMBER: ${{ github.event.number || github.event.issue.number }} | |
run: | | |
set -euo pipefail | |
echo "event name: $GITHUB_EVENT_NAME" | |
case "$GITHUB_EVENT_NAME" in | |
"issues") cmd=issue ;; | |
"pull_request_target") cmd=pr ;; | |
*) | |
echo "::error::This action must only be run on 'issue' and 'pull_request_target' events" | |
exit 1 | |
;; | |
esac | |
echo "cmd: $cmd" | |
gh $cmd edit --repo "$GITHUB_REPOSITORY" "$ISSUE_PR_NUMBER" --add-project 'Triage/bugs' | |
echo "$cmd updated" | |
gh $cmd comment --repo "$GITHUB_REPOSITORY" "$ISSUE_PR_NUMBER" --body '@MithrilJS/triage Please take a look.' | |
echo "$cmd comment posted" |