add-content-to-project.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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:
  7. # NOTE: The way content is added to project board is equivalent to an "upsert".
  8. # Calling it multiple times will be idempotent.
  9. types: [opened, reopened, ready_for_review]
  10. jobs:
  11. add-content-to-project:
  12. name: "Add Content to project"
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: "Set Issue to 'Priority = Triage Next'"
  16. uses: leonsteinhaeuser/project-beta-automations@v1.2.1
  17. if: github.event_name == 'issues'
  18. with:
  19. gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
  20. organization: "hashicorp"
  21. project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
  22. resource_node_id: ${{ github.event.issue.node_id }}
  23. operation_mode: custom_field
  24. custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'
  25. - name: "Set Pull Request to 'Priority = Triage Next'"
  26. uses: leonsteinhaeuser/project-beta-automations@v1.2.1
  27. if: github.event_name == 'pull_request'
  28. with:
  29. gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
  30. organization: "hashicorp"
  31. project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
  32. resource_node_id: ${{ github.event.pull_request.node_id }}
  33. operation_mode: custom_field
  34. custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'