-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.68 KB
/
project_board.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
45
46
47
48
49
50
51
52
53
54
55
56
name: project board
on:
issues:
types: [opened, reopened, closed, assigned]
pull_request:
types: [opened, reopened, review_requested, closed]
env:
PROJECT_ID: 1
triage: 🗃️ Triage
todo: 💡 Todo
in_progress: 🚧 In Progress
done: ✅ Done
event_name: ${{ github.event_name }}
event_action: ${{ github.event.action }}
node_issue: ${{ github.event.issue.node_id }}
node_pr: ${{ github.event.pull_request.node_id }}
jobs:
move-card:
runs-on: ubuntu-latest
steps:
- name: figure type of card
id: figure
run: |
case $event_name in
issues)
NODE="$node_issue"
case $event_action in
opened | reopened | review_requested | unassigned) TO="$triage";;
assigned) TO="$todo";;
closed) TO="$done";;
esac
;;
pull_request)
NODE="$node_pr"
case $event_action in
opened | reopened | review_requested) TO="$in_progress";;
closed) TO="$done";;
esac
;;
esac
echo "will move to $TO using node: $NODE"
echo "::set-output name=moveto::$TO"
echo "::set-output name=node_id::$NODE"
- name: move card to ${{ steps.figure.outputs.moveto }}
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ${{ github.repository_owner }}
project_id: ${{ env.PROJECT_ID }}
resource_node_id: ${{ steps.figure.outputs.node_id }}
status_value: ${{ steps.figure.outputs.moveto }} # Target status