Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/.github/workflows/     Datei vom 15.10.2026 mit Größe 3 kB image not shown  

Quelle  maintainer_merge.yml  Sprache: unbekannt

 
Spracherkennung für: .yml vermutete Sprache: Algol {Algol[40] ABAP[39] CS[28]} [Methode: maximale Elemente, drei Dimensionen]

name: Maintainer merge

# triggers the action when
on:
  # the PR receives a comment
  issue_comment:
    types: [created, edited]
  # the PR receives a review
  pull_request_review:
    # whether or not it is accompanied by a comment
    types: [submitted]
  # the PR receives a review comment
  pull_request_review_comment:
    types: [created, edited]

jobs:
  ping_zulip:
    # we set some variables. The ones of the form `${{ X }}${{ Y }}` are typically not
    # both set simultaneously: depending on the event that triggers the PR, usually only one is set
    env:
      AUTHOR: ${{ github.event.comment.user.login }}${{ github.event.review.user.login }}
      PR_AUTHOR: ${{ github.event.issue.user.login }}${{ github.event.pull_request.user.login }}
      PR_NUMBER: ${{ github.event.issue.number }}${{ github.event.pull_request.number }}
      COMMENT_EVENT: ${{ github.event.comment.body }}
      COMMENT_REVIEW: ${{ github.event.review.body }}
      PR_TITLE_ISSUE: ${{ github.event.issue.title }}
      PR_TITLE_PR: ${{ github.event.pull_request.title }}
      PR_URL: ${{ github.event.issue.html_url }}${{ github.event.pull_request.html_url }}
      EVENT_NAME: ${{ github.event_name }}
    name: Ping maintainers on Zulip
    runs-on: ubuntu-latest
    if: >- # crude check to skip running this on most reviews / comments
      github.repository == 'leanprover-community/mathlib4' &&
      (github.event_name != 'issue_comment' || github.event.issue.pull_request != null) &&
      (
        contains(format('{0}{1}', github.event.comment.body, github.event.review.body), 'maintainer merge') ||
        contains(format('{0}{1}', github.event.comment.body, github.event.review.body), 'maintainer delegate')
      )
    permissions:
      contents: read
      id-token: write
    steps:
      - name: Find maintainer merge/delegate
        id: merge_or_delegate
        run: |
          echo "PR author: ${PR_AUTHOR}"
          COMMENT="${COMMENT_EVENT}${COMMENT_REVIEW}"

          # we strip `\r` since line endings from GitHub contain this character
          COMMENT="${COMMENT//$'\r'/}"

          # for debugging, we print some information
          printf '%s' "${COMMENT}" | hexdump -cC
          printf 'Comment:"%s"\n' "${COMMENT}"


          m_or_d="$(printf '%s' "${COMMENT}" |
            # captures `maintainer merge/delegate` as well as an optional `?`, ignoring subsequent spaces
            sed -n 's=^maintainer  *\(merge\|delegate\)\(?\?\) *$=\1\2=p' | head -1)"

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

          printf $'mOrD=%s\n' "
${m_or_d}" > "${GITHUB_OUTPUT}"

      # The artifact carries no outputs: `maintainer_merge_wf_run.yml` fetches the comment or
      # review from the API (using the IDs in `include_event: minimal`) and re-parses it.
      - if: ${{ ! steps.merge_or_delegate.outputs.mOrD == '' }}
        name: Emit bridge artifact
        uses: leanprover-community/privilege-escalation-bridge/emit@120e98bbb1e9438be8973be645ef67e9cddc39ba # v2.1.0
        with:
          artifact: workflow-data
          include_event: minimal
          retention_days: 5

[Dauer der Verarbeitung: 0.8 Sekunden, vorverarbeitet 2026-11-18]