Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,41 @@ name: "CLA Assistant"
on:
issue_comment:
types: [created]
# zizmor: ignore[dangerous-triggers] The CLA bot needs pull_request_target and never checks out PR code.
pull_request_target:
types: [opened,closed,synchronize]

permissions:
contents: read

jobs:
CLAssistant:
runs-on: ubuntu-latest
# Holds the coder-cla App key; only main may use it. pull_request_target and
# issue_comment runs use the base branch, so only PRs into main are checked.
environment: cla
if: >-
(github.event_name == 'issue_comment' && (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA')) ||
(github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'main')
permissions:
pull-requests: write
steps:
# Writes signatures to coder/cla, which GITHUB_TOKEN can't reach.
- name: Generate coder-cla App token
id: cla_token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ secrets.CODER_CLA_APP_ID }}
private-key: ${{ secrets.CODER_CLA_APP_PRIVATE_KEY }}
owner: coder
repositories: cla
permission-contents: write

- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/github-action@v2.6.1
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN : ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ steps.cla_token.outputs.token }}
with:
remote-organization-name: 'coder'
remote-repository-name: 'cla'
Expand Down
Loading