Update Roadmap Dates #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Arm Learning Path Roadmap Project Dates | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: | |
| - edited # Triggered when an issue is edited | |
| jobs: | |
| update-dates: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Update Start Date | |
| if: | | |
| contains(github.event.changes.fields['Status'].from, 'To Do') && | |
| contains(github.event.changes.fields['Status'].to, 'In Progress') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api graphql -f query=' | |
| mutation($id: ID!, $date: String!) { | |
| updateProjectV2ItemFieldValue( | |
| input: { | |
| projectId: "PVT_kwDOBVR2-M4A2QVf", # Replace with your actual project ID | |
| itemId: $id, | |
| fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSF4", # Replace with your Start Date field ID | |
| value: $date | |
| } | |
| ) { | |
| projectV2Item { | |
| id | |
| } | |
| } | |
| }' -f id="${{ github.event.issue.node_id }}" -f date="$(date -u +%Y-%m-%d)" | |
| - name: Update Publish Date | |
| if: | | |
| contains(github.event.changes.fields['Status'].from, 'In Progress') && | |
| contains(github.event.changes.fields['Status'].to, 'Done') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api graphql -f query=' | |
| mutation($id: ID!, $date: String!) { | |
| updateProjectV2ItemFieldValue( | |
| input: { | |
| projectId: "PVT_kwDOBVR2-M4A2QVf", # Replace with your actual project ID | |
| itemId: $id, | |
| fieldId: "PVTF_lADOBVR2-M4A2QVfzgrvSMA", # Replace with your Publish Date (end date) field ID | |
| value: $date | |
| } | |
| ) { | |
| projectV2Item { | |
| id | |
| } | |
| } | |
| }' -f id="${{ github.event.issue.node_id }}" -f date="$(date -u +%Y-%m-%d)" |