-
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.08 KB
/
notify-triage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Notify triage
on:
workflow_call:
issues:
types: [opened]
pull_request_target:
types: [opened]
permissions:
id-token: write
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.'