Skip to content

Fix reject-pr.yml

Fix reject-pr.yml #1

Workflow file for this run

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.'