|
| 1 | +--- |
| 2 | +name: Label pull requests |
| 3 | + |
| 4 | +on: # yamllint disable-line rule:truthy |
| 5 | + pull_request: |
| 6 | + types: |
| 7 | + - edited |
| 8 | + - opened |
| 9 | + - synchronize |
| 10 | + |
| 11 | +# Set a default shell for any run steps. The `-Eueo pipefail` sets errtrace, |
| 12 | +# nounset, errexit, and pipefail. The `-x` will print all commands as they are |
| 13 | +# run. Please see the GitHub Actions documentation for more information: |
| 14 | +# https://docs.github.com/en/actions/using-jobs/setting-default-values-for-jobs |
| 15 | +defaults: |
| 16 | + run: |
| 17 | + shell: bash -Eueo pipefail -x {0} |
| 18 | + |
| 19 | +jobs: |
| 20 | + diagnostics: |
| 21 | + name: Run diagnostics |
| 22 | + # This job does not need any permissions |
| 23 | + permissions: {} |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + # Note that a duplicate of this step must be added at the top of |
| 27 | + # each job. |
| 28 | + - name: Apply standard cisagov job preamble |
| 29 | + uses: cisagov/action-job-preamble@v1 |
| 30 | + with: |
| 31 | + check_github_status: "true" |
| 32 | + # This functionality is poorly implemented and has been |
| 33 | + # causing problems due to the MITM implementation hogging or |
| 34 | + # leaking memory. As a result we disable it by default. If |
| 35 | + # you want to temporarily enable it, simply set |
| 36 | + # monitor_permissions equal to "true". |
| 37 | + # |
| 38 | + # TODO: Re-enable this functionality when practical. See |
| 39 | + # cisagov/skeleton-generic#207 for more details. |
| 40 | + monitor_permissions: "false" |
| 41 | + output_workflow_context: "true" |
| 42 | + # Use a variable to specify the permissions monitoring |
| 43 | + # configuration. By default this will yield the |
| 44 | + # configuration stored in the cisagov organization-level |
| 45 | + # variable, but if you want to use a different configuration |
| 46 | + # then simply: |
| 47 | + # 1. Create a repository-level variable with the name |
| 48 | + # ACTIONS_PERMISSIONS_CONFIG. |
| 49 | + # 2. Set this new variable's value to the configuration you |
| 50 | + # want to use for this repository. |
| 51 | + # |
| 52 | + # Note in particular that changing the permissions |
| 53 | + # monitoring configuration *does not* require you to modify |
| 54 | + # this workflow. |
| 55 | + permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} |
| 56 | + label: |
| 57 | + needs: |
| 58 | + - diagnostics |
| 59 | + permissions: |
| 60 | + # Permissions required by actions/labeler |
| 61 | + contents: read |
| 62 | + issues: write |
| 63 | + pull-requests: write |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: Apply standard cisagov job preamble |
| 67 | + uses: cisagov/action-job-preamble@v1 |
| 68 | + with: |
| 69 | + # This functionality is poorly implemented and has been |
| 70 | + # causing problems due to the MITM implementation hogging or |
| 71 | + # leaking memory. As a result we disable it by default. If |
| 72 | + # you want to temporarily enable it, simply set |
| 73 | + # monitor_permissions equal to "true". |
| 74 | + # |
| 75 | + # TODO: Re-enable this functionality when practical. See |
| 76 | + # cisagov/skeleton-generic#207 for more details. |
| 77 | + monitor_permissions: "false" |
| 78 | + # Use a variable to specify the permissions monitoring |
| 79 | + # configuration. By default this will yield the |
| 80 | + # configuration stored in the cisagov organization-level |
| 81 | + # variable, but if you want to use a different configuration |
| 82 | + # then simply: |
| 83 | + # 1. Create a repository-level variable with the name |
| 84 | + # ACTIONS_PERMISSIONS_CONFIG. |
| 85 | + # 2. Set this new variable's value to the configuration you |
| 86 | + # want to use for this repository. |
| 87 | + # |
| 88 | + # Note in particular that changing the permissions |
| 89 | + # monitoring configuration *does not* require you to modify |
| 90 | + # this workflow. |
| 91 | + permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} |
| 92 | + - name: Apply suitable labels to a pull request |
| 93 | + uses: actions/labeler@v6 |
0 commit comments