Files
carbon-lang/.github/workflows/proposal_ready.yaml
T
Jon Ross-Perkins 97816a3598 Use https://app.stepsecurity.io/secureworkflow to improve workflow security. (#3879)
This is coming out of advice from
https://securityscorecards.dev/viewer/?uri=github.com/carbon-language/carbon-lang

Updates action versions and pins by checksum. This is something we
already do in other places, and doing it with actions just seems
consistent.

Trying to add token permissions at the same time.

step-security/harden-runner is being set up to monitor network traffic
for actions, with the idea that we'd set it to block unexpected traffic
in the future.

Note, https://app.stepsecurity.io/secureworkflow generates the pinned
checksums and adds the harden-runner. In some cases it added token
permissions, but we have a couple it doesn't recognize (`gh` executions,
other custom commands, jlumbroso/free-disk-space, reviewdog/action-setup
as examples) so I'm trying to guess my best.

Because these are workflows, testing is limited.
2024-04-15 14:40:38 +00:00

37 lines
1.1 KiB
YAML

# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Applies the "proposal rfc" label when a proposal is marked ready for review.
name: Proposal ready for review
on:
pull_request_target:
types:
- ready_for_review
permissions:
pull-requests: write # For gh to edit labels.
jobs:
proposal_ready:
if: contains(github.event.pull_request.labels.*.name, 'proposal')
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: rfc
run: |
gh pr edit "${PR}" \
--remove-label "proposal draft" \
--remove-label "proposal accepted" \
--remove-label "proposal declined" \
--remove-label "proposal deferred" \
--add-label "proposal rfc"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}