Files
VoiceStudio/.github/workflows/cla.yml
T

56 lines
2.2 KiB
YAML

# Contributor License Agreement check.
#
# Every pull request's opener and commit authors and co-authors sign
# .github/CLA-1.0.md once, by comment. .github/scripts/cla_check.py records
# signatures on the `cla-signatures` branch (created on first use) and sets the
# "CLA" commit status that branch protection requires alongside the native
# "CLA gate" job, which blocks merging if a status API write fails. Past contributors can
# also sign on any issue a maintainer labels `cla`; a maintainer can apply
# `cla-override` to a pull request after reviewing it by hand. The check also
# keeps the informational `cla-signed` label in step with its result.
#
# Security: pull_request_target and issue_comment run with a write token, even
# for fork PRs. This workflow therefore checks out only the base branch (the
# default for both events) and runs the base branch's checker; pull-request code
# is never checked out or executed. tests/test_cla_workflow.py enforces that.
name: CLA
on:
pull_request_target:
# unlabeled: removing `cla-override` rechecks; edited: so does changing
# `Supersedes #N` in the description.
types: [opened, synchronize, reopened, closed, labeled, unlabeled, edited]
issue_comment:
types: [created]
permissions:
contents: read
jobs:
cla:
name: CLA gate
if: >-
github.event_name == 'pull_request_target' ||
contains(github.event.comment.body, 'VoiceStudio CLA') ||
(github.event.issue.pull_request && contains(github.event.comment.body, 'recheck'))
runs-on: ubuntu-24.04
# Job level, so comments the `if` skips never take the queue slot. Each run
# rescans all comments, so a queued run GitHub cancels loses nothing.
concurrency:
group: cla-${{ github.event.pull_request.number || github.event.issue.number }}
permissions:
contents: write
issues: write
pull-requests: write
statuses: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Check CLA signatures
run: python3 .github/scripts/cla_check.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}