Fix reject-pr.yml #1
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: | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Run workflow | |
env: | |
GH_TOKEN_SECRET: ${{ github.token }} | |
run: | | |
set -euo pipefail | |
echo "event name: $GITHUB_EVENT_NAME" | |
case "$GITHUB_EVENT_NAME" in | |
"issue") | |
cmd=issue | |
url="$(jq -r .issue.url <"$GITHUB_EVENT_PATH")" | |
;; | |
"pull_request_target") | |
cmd=pr | |
url="$(jq -r .pull_request.url <"$GITHUB_EVENT_PATH")" | |
;; | |
*) | |
echo "::error::This action must only be run on 'issue' and 'pull_request_target' events" | |
exit 1 | |
;; | |
esac | |
echo "cmd: $cmd" | |
echo "url: $url" | |
export GITHUB_TOKEN="$GH_TOKEN_SECRET" | |
gh $cmd edit "$url" --add-project 'Triage/bugs' && | |
gh $cmd comment "$url" --body '@MithrilJS/triage Please take a look.' |