Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/MathlibTest/Tactic/     Datei vom 15.10.2026 mit Größe 8 kB image not shown  

SSL maintainer_bors_wf_run.yml  Interaktion und
Portierbarkeitunbekannt

 
Spracherkennung für: .yml vermutete Sprache: Algol {Algol[45] SPS[37] Fortran[36]} [Methode: maximale Elemente, drei Dimensionen]

name: Bors merge/delegate follow-up (workflow_run)

on:
  workflow_run:
    workflows: ['Bors merge/delegate follow-up']
    types:
      - completed

permissions:
  actions: read
  contents: read


jobs:
  bors_command_followup:
    name: Bors merge/delegate follow-up
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'leanprover-community/mathlib4' && github.event.workflow_run.conclusion == 'success' }}
    permissions:
      actions: read
      contents: read
      id-token: write
      issues: read # for `verify` on issue comments
      pull-requests: read # for `verify`
    steps:
      # For review events, GitHub runs the producer workflow from the PR, so the artifact is
      # untrusted. With `verify`, the bridge fetches the comment or review and its PR from the
      # API and checks them against GitHub's record of the producer run; we only use those
      # verified values, never the artifact'
s own contents.
      - name: Consume bridge artifact
        id: bridge
        uses: leanprover-community/privilege-escalation-bridge/consume@120e98bbb1e9438be8973be645ef67e9cddc39ba # v2.1.0
        with:
          artifact: workflow-data
          source_workflow: Bors merge/delegate follow-up
          require_event: issue_comment,pull_request_review,pull_request_review_comment
          verify: true
          fail_on_missing: false
          token: ${{ github.token }}
          extract: |
            author=verified.trigger.author
            comment=verified.trigger.body
            pr_number=verified.pr.number

      - name: Find bors merge/delegate
        id: merge_or_delegate
        if: ${{ steps.bridge.outputs.pr_number != '' }}
        env:
          AUTHOR: ${{ steps.bridge.outputs.author }}
          COMMENT: ${{ steps.bridge.outputs.comment }}
        run: |
          # same parsing as in maintainer_bors.yml, but applied to the verified comment and author
          # we strip `\r` since line endings from GitHub contain this character
          COMMENT="${COMMENT//$'\r'/}"
          m_or_d="$(printf '%s' "${COMMENT}" |
            sed -n 's=^bors  *\(merge\|r+\) *$=ready-to-merge=p; s=^bors  *\(delegate\|d+\|d\=\).*=delegated=p' | head -1)"

          printf $'"
bors delegate" or "bors merge" found? \'%s\'\n' "${m_or_d}"
          printf $'AUTHOR: \'%s\'\n' "
${AUTHOR}"

          printf $'mOrD=%s\n' "
${m_or_d}" >> "${GITHUB_OUTPUT}"
          if [ "
${AUTHOR}" == 'mathlib-bors[bot]' ] ||
             [ "
${AUTHOR}" == 'mathlib-triage[bot]' ]
          then
            printf $'bot=true\n'
            printf $'bot=true\n' >> "
${GITHUB_OUTPUT}"
          else
            printf $'bot=false\n'
            printf $'bot=false\n' >> "
${GITHUB_OUTPUT}"
          fi

      - name: Check whether user is a mathlib admin
        id: user_permission
        if: ${{ steps.merge_or_delegate.outputs.mOrD != '' }}
        uses: actions-cool/check-user-permission@c21884f3dda18dafc2f8b402fe807ccc9ec1aa5e # v2.4.0
        with:
          username: ${{ steps.bridge.outputs.author }}
          require: 'admin'

      - name: Generate app token
        id: app-token
        uses: leanprover-community/mathlib-ci/.github/actions/azure-create-github-app-token@d6393a535c054122e507b6c5e1b2f4c31c604121
        if: ${{ steps.merge_or_delegate.outputs.mOrD != '' }}
        with:
          app-id: ${{ secrets.MATHLIB_TRIAGE_APP_ID }}
          key-vault-name: ${{ vars.MATHLIB_AZ_KEY_VAULT_NAME }}
          key-name: mathlib-triage-app-pk
          azure-client-id: ${{ vars.GH_APP_AZURE_CLIENT_ID_TRIAGE }}
          azure-tenant-id: ${{ secrets.LPC_AZ_TENANT_ID }}

      # The `ready-to-merge` / `delegated` lifecycle labels are managed by bors
      # itself (see the `[labels]` table in bors.toml); this workflow no longer
      # adds or removes them. It still removes the `awaiting-author` and
      # `maintainer-merge` labels on a merge/delegate command. (Zulip emoji
      # reactions are kept in sync by the `zulip_emoji_reconcile` workflow.)
      - if: ${{ steps.merge_or_delegate.outputs.mOrD != '' &&
          ( steps.user_permission.outputs.require-result == 'true' ||
            steps.merge_or_delegate.outputs.bot == 'true' ) }}
        id: remove_labels
        name: Remove "
awaiting-author" and "maintainer-merge"
        # we use curl rather than octokit/request-action so that the job won't fail
        # (and send an annoying email) if the labels don't exist
        env:
          PR_NUMBER: ${{ steps.bridge.outputs.pr_number }}
        run: |
          for label in awaiting-author maintainer-merge; do
            curl --request DELETE \
              --url "
https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/${label}" \
              --header 'authorization: Bearer ${{ steps.app-token.outputs.token }}'
          done

[Verzeichnis aufwärts0.117unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-11-18]