chore(deps): bump step-security/harden-runner from 2.13.1 to 2.13.2 #801
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Label Checker | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - labeled | |
| - unlabeled | |
| permissions: | |
| issues: read | |
| pull-requests: read | |
| env: | |
| VALID_SEMVER_LABELS: norelease,release:major,release:minor,release:patch | |
| jobs: | |
| check_labels: | |
| name: Check labels | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7 | |
| with: | |
| script: | | |
| const validLabels = process.env.VALID_SEMVER_LABELS.split(","); | |
| const { data: labelResultList } = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number | |
| }); | |
| const prLabels = labelResultList.map(label => label.name); | |
| const semverLabels = prLabels.filter(value => validLabels.includes(value)); | |
| core.info(`Valid labels: ${validLabels.join(" | ")}`); | |
| core.info(`PR labels: ${prLabels.join(" | ")}`); | |
| core.info(`Semver Labels: ${semverLabels.join(" | ")}`); | |
| if (semverLabels.length == 0) { | |
| core.setFailed("You must add a SemVer label of one of ${validLabels.join(" | ")} to this PR"); | |
| } | |
| if (semverLabels.length > 1) { | |
| core.setFailed("You must only add one SemVer label to this PR"); | |
| } |