Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

fix(ci): harden CLA workflow — SHA-pin, drop write scopes, replace PAT (CHOO-1251, H3) (#111)

Louis Amaudruz227d0eea444a
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
index 8799376f3..acb8d28d6 100644
--- a/.github/workflows/cla.yml
+++ b/.github/workflows/cla.yml
@@ -7,8 +7,6 @@ on:
types: [opened, synchronize]
permissions:
- actions: write
- contents: write
pull-requests: write
statuses: write
@@ -16,23 +14,35 @@ jobs:
cla:
runs-on: ubuntu-latest
steps:
+ - name: Generate a scoped, short-lived token for the CLA bot
+ id: app-token
+ 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: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
+ with:
+ client-id: ${{ secrets.CLA_BOT_CLIENT_ID }}
+ private-key: ${{ secrets.CLA_BOT_APP_PRIVATE_KEY }}
+ permission-contents: write
+ permission-pull-requests: write
+ permission-statuses: write
+ permission-actions: 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/[email protected]
+ uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # A PAT (repo scope) is required so the bot can persist signatures and
- # re-run the status check. Add it as a repository secret named
- # PERSONAL_ACCESS_TOKEN — the workflow will not function without it.
- PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
+ PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
with:
path-to-signatures: signatures/version1/cla.json
path-to-document: https://github.com/sandbox-quantum/switch/blob/main/CLA.md
branch: main
- allowlist: dependabot[bot],*[bot]
+ allowlist: dependabot[bot],renovate[bot],socket-fix[bot]
custom-notsigned-prcomment: >-
Thank you for your contribution! Before we can merge it, please read
our [Contributor License Agreement](https://github.com/sandbox-quantum/switch/blob/main/CLA.md)