update_project_card.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. name: Update label from project card
  5. on:
  6. project_card:
  7. types: [moved]
  8. # To get project IDs: https://docs.github.com/en/graphql/overview/explorer
  9. # {
  10. # repository(name: "carbon-lang", owner: "carbon-language") {
  11. # projects(first: 10) {
  12. # nodes {
  13. # name
  14. # databaseId
  15. # }
  16. # }
  17. # }
  18. # }
  19. jobs:
  20. update-project-card-label:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Label proposals
  24. uses: Matticusau/projectcard-autolabel@v1.0.0
  25. # Only run on proposals.
  26. if:
  27. github.event.project_card.project_url ==
  28. 'https://api.github.com/projects/11995172'
  29. with:
  30. # Label casing must match precisely for removal to work.
  31. autolabel-config: >
  32. [
  33. {"column": "draft",
  34. "add_labels": ["proposal"],
  35. "remove_labels": ["RFC",
  36. "decision: accepted",
  37. "decision: deferred",
  38. "decision: declined"]},
  39. {"column": "RFC",
  40. "add_labels": ["proposal", "RFC"],
  41. "remove_labels": ["decision: accepted",
  42. "decision: deferred",
  43. "decision: declined"]},
  44. {"column": "Accepted",
  45. "add_labels": ["proposal", "decision: accepted"],
  46. "remove_labels": ["RFC",
  47. "decision: deferred",
  48. "decision: declined"]},
  49. {"column": "Deferred",
  50. "add_labels": ["proposal", "decision: deferred"],
  51. "remove_labels": ["RFC",
  52. "decision: accepted",
  53. "decision: declined"]},
  54. {"column": "Declined",
  55. "add_labels": ["proposal", "decision: declined"],
  56. "remove_labels": ["RFC",
  57. "decision: accepted",
  58. "decision: deferred"]}]
  59. # I tried making the project filter work, but when I tried to put the
  60. # project into the filter the action stopped matching, so I used the
  61. # `if` instead.
  62. projectfilter-config: '{"include": ["*"]}'
  63. repo-token: ${{ secrets.GITHUB_TOKEN }}