|
| 1 | +name: Issue Project Automation |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened, labeled, unlabeled] |
| 6 | + |
| 7 | +jobs: |
| 8 | + # When an issue is opened, add it to default project(s) |
| 9 | + add-new-issue-to-project: |
| 10 | + if: github.event.action == 'opened' |
| 11 | + uses: NASA-PDS/.github/.github/workflows/add-issue-to-project.yml@main |
| 12 | + with: |
| 13 | + issue_number: ${{ github.event.issue.number }} |
| 14 | + repository: ${{ github.repository }} |
| 15 | + # Update project_numbers below based on your needs |
| 16 | + # Single project: project_numbers: "6" |
| 17 | + # Multiple projects: project_numbers: "6,22" |
| 18 | + project_numbers: "6" |
| 19 | + secrets: |
| 20 | + # IMPORTANT: GITHUB_TOKEN does not have permission for org projects |
| 21 | + # You must create a PAT with 'project' scope and add it as ORG_PROJECT_PAT |
| 22 | + # See workflow-templates/README.md for setup instructions |
| 23 | + gh_token: ${{ secrets.ORG_PROJECT_PAT }} |
| 24 | + |
| 25 | + # When a label is added or removed, handle build labels and sprint-backlog automation |
| 26 | + handle-label: |
| 27 | + if: github.event.action == 'labeled' || github.event.action == 'unlabeled' |
| 28 | + uses: NASA-PDS/.github/.github/workflows/label-to-project.yml@main |
| 29 | + with: |
| 30 | + issue_number: ${{ github.event.issue.number }} |
| 31 | + repository: ${{ github.repository }} |
| 32 | + label_name: ${{ github.event.label.name }} |
| 33 | + action: ${{ github.event.action }} |
| 34 | + secrets: |
| 35 | + gh_token: ${{ secrets.ORG_PROJECT_PAT }} |
0 commit comments