forked from cds-snc/notification-api
-
Notifications
You must be signed in to change notification settings - Fork 9
43 lines (37 loc) · 1.46 KB
/
dependency-ticket-creation.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
name: Biweekly Dependency Ticket Creation
on:
push:
branches:
- "1381-dependency-ticket-automation"
jobs:
create_issue:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create GitHub Issue
id: create_issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ISSUE_URL=$(gh issue create \
--body-file "./.github/ISSUE_TEMPLATE/notify-dependency-update-template.md" \
--label "Notify" \
--label "QA" \
--label "Tech Debt" \
--title "Regular Update for Dependencies" \
--json url \
-q .url)
echo "issue_url=${ISSUE_URL}" >> $GITHUB_ENV
- name: Get Issue Number
id: get_issue_number
run: echo "issue_number=${{ steps.create_issue.outputs.issue_url##*/ }}" >> $GITHUB_ENV
- name: Move Issue to "To Do" Column in Project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Replace these with your project and column details
PROJECT_NUMBER=1417
TODO_COLUMN_ID=$(gh project column list --project "${PROJECT_NUMBER}" --json id,name --jq '.[] | select(.name=="To Do") | .id')
# Add the issue to the project column
gh project item add --project "${PROJECT_NUMBER}" --content-type "Issue" --content-id "${{ env.issue_number }}" --column-id "${TODO_COLUMN_ID}"