proposal_ready.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # Applies the "proposal rfc" label when a proposal is marked ready for review.
  5. name: Proposal ready for review
  6. on:
  7. pull_request_target:
  8. types:
  9. - ready_for_review
  10. permissions:
  11. pull-requests: write # For gh to edit labels.
  12. # TODO: `--repo carbon-language/carbon-lang` is a temporary workaround for:
  13. # https://github.com/cli/cli/issues/11055
  14. # Once a later version is released on runners, maybe August 2025, we should be
  15. # able to remove the extra flag.
  16. jobs:
  17. proposal_ready:
  18. if: contains(github.event.pull_request.labels.*.name, 'proposal')
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: Harden Runner
  22. uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
  23. with:
  24. disable-sudo: true
  25. egress-policy: block
  26. # prettier-ignore
  27. allowed-endpoints: >
  28. api.github.com:443
  29. - name: rfc
  30. run: |
  31. gh pr edit "${PR}" \
  32. --remove-label "proposal draft" \
  33. --remove-label "proposal accepted" \
  34. --remove-label "proposal declined" \
  35. --remove-label "proposal deferred" \
  36. --add-label "proposal rfc" \
  37. --repo carbon-language/carbon-lang
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. PR: ${{ github.event.pull_request.html_url }}