add-content-to-project.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Based on https://github.com/leonsteinhaeuser/project-beta-automations
  2. name: "Add Issues/PRs to TF Provider DevEx team board"
  3. on:
  4. issues:
  5. types: [opened, reopened]
  6. pull_request_target:
  7. # NOTE: The way content is added to project board is equivalent to an "upsert".
  8. # Calling it multiple times will be idempotent.
  9. #
  10. # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
  11. # to see the reasoning behind using `pull_request_target` instead of `pull_request`
  12. types: [opened, reopened, ready_for_review]
  13. jobs:
  14. add-content-to-project:
  15. name: "Add Content to project"
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: "Set Issue to 'Priority = Triage Next'"
  19. uses: leonsteinhaeuser/project-beta-automations@v2.0.0
  20. if: github.event_name == 'issues'
  21. with:
  22. gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
  23. organization: "hashicorp"
  24. project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
  25. resource_node_id: ${{ github.event.issue.node_id }}
  26. operation_mode: custom_field
  27. custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'
  28. - name: "Set Pull Request to 'Priority = Triage Next'"
  29. uses: leonsteinhaeuser/project-beta-automations@v2.0.0
  30. if: github.event_name == 'pull_request_target'
  31. with:
  32. gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
  33. organization: "hashicorp"
  34. project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
  35. resource_node_id: ${{ github.event.pull_request.node_id }}
  36. operation_mode: custom_field
  37. custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'