Spracherkennung für: .yaml vermutete Sprache: SQL {SQL[57] VHDL[39] Fortran[36]} [Methode: maximale Elemente, drei Dimensionen]
name: Autolabel PRs
on:
pull_request_target:
types: [opened]
# Limit permissions for GITHUB_TOKEN for the entire workflow
permissions:
contents: read
pull-requests: write # Only allow PR comments/labels
# All other permissions are implicitly 'none'
jobs:
add_topic_label:
name: Add topic label
runs-on: ubuntu-latest
# Don't run on forks, where we wouldn't have permissions to add the label anyway.
if: github.repository == 'leanprover-community/mathlib4'
steps:
- name: Checkout master branch to build autolabel from
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: master
path: tools
- name: Configure Lean
uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: false
lake-package-directory: tools # Building here
- name: Build autolabel from master
working-directory: tools
run: |
lake build autolabel
- name: Checkout branch to label
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
path: pr-branch
# Untrusted (potentially fork) checkout:
# don't persist the GITHUB_TOKEN into its .git/config.
persist-credentials: false
# autolabel is built from the trusted base checkout and only reads these files,
# so checking out fork PR code under pull_request_target is safe.
allow-unsafe-pr-checkout: true
- name: Run autolabel
working-directory: pr-branch
run: |
set +e
"${GITHUB_WORKSPACE}/tools/.lake/build/bin/autolabel" \
--pr "${PR_NUMBER}" \
--curl "${GH_TOKEN}"
code=$?
if [ "$code" -ne 0 ]; then
echo "::warning file=scripts/autolabel.lean::autolabel exited with code ${code}. \
If this PR adds or removes directories, please update \
\`scripts/autolabel.lean\` in the same PR so \`master\` stays consistent."
fi
exit 0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
[Dauer der Verarbeitung: 0.4 Sekunden, vorverarbeitet 2026-11-18]