mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-10 12:28:25 +00:00
- `actions/cache` 5.0.3 -> 6.1.0 (major) - `actions/checkout` 6.0.2 -> 7.0.1 (major) - `actions/configure-pages` 5.0.0 -> 6.0.0 (major) - `actions/deploy-pages` 4.0.5 -> 5.0.1 (major) - `actions/stale` 9.0.0 -> 11.0.0 (major) - `actions/upload-pages-artifact` 4.0.0 -> 5.0.0 (major) - `astral-sh/setup-uv` 8.1.0 -> 10.3.3 (major) - `dorny/paths-filter` 3.0.2 -> 4.0.3 (major) - `jlumbroso/free-disk-space` 1.3.1 -> 2.0.0 (major) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
124 lines
4.2 KiB
YAML
124 lines
4.2 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
|
|
|
|
name: 'Auto label PRs'
|
|
on:
|
|
# zizmor: ignore[dangerous-triggers] - {necessary to mutate the PR}
|
|
pull_request_target:
|
|
types: [opened, ready_for_review]
|
|
|
|
permissions:
|
|
pull-requests: write # For gh to edit labels.
|
|
|
|
# TODO: `--repo carbon-language/carbon-lang` is a temporary workaround for:
|
|
# https://github.com/cli/cli/issues/11055
|
|
# Once a later version is released on runners, maybe August 2025, we should be
|
|
# able to remove the extra flag.
|
|
jobs:
|
|
set_labels:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3
|
|
with:
|
|
disable-sudo: true
|
|
egress-policy: block
|
|
# prettier-ignore
|
|
allowed-endpoints: >
|
|
api.github.com:443
|
|
|
|
- id: filter
|
|
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
|
|
with:
|
|
filters: |
|
|
documentation:
|
|
- '*.md'
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- 'third_party/examples/**'
|
|
|
|
infrastructure:
|
|
- '*.bzl'
|
|
- '*.cfg'
|
|
- '*.toml'
|
|
- '.*'
|
|
- '.*/**'
|
|
- 'BUILD'
|
|
- 'MODULE.*'
|
|
- 'WORKSPACE'
|
|
- 'bazel/**'
|
|
- 'github_tools/**'
|
|
- 'proposals/scripts/**'
|
|
- 'scripts/**'
|
|
|
|
# Here we only want the `proposal` label when a *new* file is added
|
|
# directly in this directory. We use `added` and a single level glob
|
|
# to achieve that.
|
|
proposal:
|
|
- added: 'proposals/*'
|
|
|
|
# We include common, shared code into the toolchain label for
|
|
# convenience. Essentially, this is everything we intend to ship as
|
|
# part of the reference implementation of the language.
|
|
toolchain:
|
|
- 'common/**'
|
|
- 'core/**'
|
|
- 'testing/**'
|
|
- 'toolchain/**'
|
|
|
|
utilities:
|
|
- 'utils/**'
|
|
|
|
- id: documentation
|
|
if: steps.filter.outputs.documentation == 'true'
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "documentation" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|
|
|
|
- id: infrastructure
|
|
if: steps.filter.outputs.infrastructure == 'true'
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "infrastructure" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|
|
|
|
- id: proposal
|
|
if: steps.filter.outputs.proposal == 'true'
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "proposal" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|
|
|
|
- id: toolchain
|
|
if: steps.filter.outputs.toolchain == 'true'
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "toolchain" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|
|
|
|
- id: utilities
|
|
if: steps.filter.outputs.utilities == 'true'
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "utilities" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|
|
|
|
# Note that this is not a path-based label, but an *author* based label,
|
|
# and it applies orthogonally to the others.
|
|
- id: bot
|
|
if:
|
|
contains(fromJSON('["CarbonInfraBot", "dependabot[bot]"]'),
|
|
github.event.pull_request.user.login)
|
|
run: |
|
|
gh pr edit "${PR}" --add-label "bot" --repo carbon-language/carbon-lang
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.html_url }}
|