Skip to content

Commit a00e180

Browse files
authored
Update update-roadmap-project-dates.yml
1 parent c9e6739 commit a00e180

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
name: Update Arm Learning Path Roadmap Project Dates
22

33
on:
4-
project_item:
4+
issues:
55
types:
6-
- created
7-
- edited
6+
- edited # Triggered when an issue is edited
87

98
jobs:
109
update-dates:
1110
runs-on: ubuntu-latest
1211
steps:
1312
- name: Update Start Date
14-
if: ${{ github.event.changes.fields['Status'] == 'In Progress' }}
13+
if: |
14+
contains(github.event.changes.fields['Status'].from, 'To Do') &&
15+
contains(github.event.changes.fields['Status'].to, 'In Progress')
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1518
run: |
1619
gh api graphql -f query='
1720
mutation($id: ID!, $date: String!) {
1821
updateProjectV2ItemFieldValue(
1922
input: {
20-
projectId: "PVT_kwDOBVR2-M4A2QVf",
23+
projectId: "PVT_kwDOBVR2-M4A2QVf", # Replace with your actual project ID
2124
itemId: $id,
22-
fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSF4",
25+
fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSF4", # Replace with your Start Date field ID
2326
value: $date
2427
}
2528
) {
2629
projectV2Item {
2730
id
2831
}
2932
}
30-
}' -f id="${{ github.event.project_item.node_id }}" -f date="$(date -u +%Y-%m-%d)"
31-
33+
}' -f id="${{ github.event.issue.node_id }}" -f date="$(date -u +%Y-%m-%d)"
34+
3235
- name: Update Publish Date
33-
if: ${{ github.event.changes.fields['Status'] == 'Done' }}
36+
if: |
37+
contains(github.event.changes.fields['Status'].from, 'In Progress') &&
38+
contains(github.event.changes.fields['Status'].to, 'Done')
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3441
run: |
3542
gh api graphql -f query='
3643
mutation($id: ID!, $date: String!) {
3744
updateProjectV2ItemFieldValue(
3845
input: {
39-
projectId: "PVT_kwDOBVR2-M4A2QVf",
46+
projectId: "PVT_kwDOBVR2-M4A2QVf", # Replace with your actual project ID
4047
itemId: $id,
41-
fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSMA",
48+
fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSMA", # Replace with your Publish Date (end date) field ID
4249
value: $date
4350
}
4451
) {
4552
projectV2Item {
4653
id
4754
}
4855
}
49-
}' -f id="${{ github.event.project_item.node_id }}" -f date="$(date -u +%Y-%m-%d)"
56+
}' -f id="${{ github.event.issue.node_id }}" -f date="$(date -u +%Y-%m-%d)"

0 commit comments

Comments
 (0)