Test pull request flow #6
Workflow file for this run
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] | |
permissions: | |
issues: write | |
repository-projects: write | |
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: ${{ github.token }} | |
run: | | |
set -euo pipefail | |
echo "event name: $GITHUB_EVENT_NAME" | |
case "$GITHUB_EVENT_NAME" in | |
"issue") 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 | |
id="$(jq -r .number <"$GITHUB_EVENT_PATH")" | |
echo "cmd: $cmd" | |
echo "id: $id" | |
gh $cmd edit --repo "$GITHUB_REPOSITORY" "$id" --add-project 'Triage/bugs' | |
gh $cmd comment --repo "$GITHUB_REPOSITORY" "$id" --body '@MithrilJS/triage Please take a look.' |