Feature: test issue #1
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: Add new issues to Project | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| add_to_p1: | |
| if: contains(fromJson('["backlog"]'), github.event.repository.name) # filter by repository name | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Authenticate with GitHub App | |
| id: auth | |
| uses: tibdex/github-app-token@v1 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.PRIVATE_KEY }} | |
| installation_id: ${{ secrets.INSTALLATION_ID }} | |
| - name: Add issue to Project Board | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ steps.auth.outputs.token }} | |
| script: | | |
| const projectId = "PVT_kwDOClHx584AyckH"; // Project ID for "Refinement Board" (can be retrieved with workflow in get-project-column-ids.yml) | |
| const issue = context.payload.issue; | |
| const org = context.payload.repository.owner.login; | |
| // Add label "needs/validation" | |
| await github.rest.issues.addLabels({ | |
| owner: org, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| labels: ["needs/validation"] | |
| }); | |
| // Add issue to P1 | |
| await github.rest.projects.createCard({ | |
| column_id: "f75ad846", // Column ID for "needs/validation" (can be retrieved with workflow in get-project-column-ids.yml) | |
| content_id: issue.id, | |
| content_type: "Issue" | |
| }); |