Skip to content
Merged
Show file tree
Hide file tree
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
40 changes: 7 additions & 33 deletions .github/workflows/cla-assistant.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CLA validation
name: CLA Validation

on:
issue_comment:
Expand All @@ -8,39 +8,13 @@ on:

permissions:
actions: write
contents: read
contents: read
pull-requests: write
statuses: write

jobs:
CLAAssistant:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Create CLA Assistant Lite bot token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.SILABSIN_CLA_BOT_APP_ID }}
private-key: ${{ secrets.SILABSIN_CLA_BOT_APP_PRIVATE_KEY }}
owner: SiliconLabsInternal
repositories: contributor-license-agreements

- name: Mask generated token
run: echo "::add-mask::${{ steps.app-token.outputs.token }}"

- name: "CLA Assistant"
if: ${{ contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA') }} || github.event_name == 'pull_request_target'
uses: SiliconLabsSoftware/action-cla-assistant@silabs_flavour_v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
with:
path-to-signatures: "cla_signatures_db.json"
path-to-document: "https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md"
branch: 'cla-database'
allowlist: silabs-*,bot*
remote-organization-name: "SiliconLabsInternal"
remote-repository-name: "contributor-license-agreements"
create-file-commit-message: "Created the CLA database file. CLA Assistant Lite bot created this file."
signed-commit-message: "$contributorName has signed the CLA in $owner/$repo#$pullRequestNo"
uses: ./.github/workflows/cla.yml
secrets:
CLA_APP_ID: ${{ secrets.SILABSIN_CLA_BOT_APP_ID }}
CLA_APP_PRIVATE_KEY: ${{ secrets.SILABSIN_CLA_BOT_APP_PRIVATE_KEY }}
72 changes: 72 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Reusable CLA validation

on:
workflow_call:
inputs:
remote_org:
type: string
default: "SiliconLabsInternal"
remote_repo:
type: string
default: "contributor-license-agreements"
signatures_path:
type: string
default: "cla_signatures_db.json"
document_url:
type: string
default: "https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md"
allowlist:
type: string
default: silabs-*,bot*
branch:
type: string
default: "cla-database"
runner:
type: string
default: "ubuntu-latest"
secrets:
CLA_APP_ID:
required: true
CLA_APP_PRIVATE_KEY:
required: true

permissions:
actions: write
contents: read
pull-requests: write
statuses: write

jobs:
cla:
runs-on: ${{ inputs.runner }}
if: |
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.user.login != 'silabs-matter-ci-bot'
steps:
- name: Create CLA Assistant Lite bot token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.CLA_APP_ID }}
private-key: ${{ secrets.CLA_APP_PRIVATE_KEY }}
owner: ${{ inputs.remote_org }}
repositories: ${{ inputs.remote_repo }}

- name: Mask generated token
run: echo "::add-mask::${{ steps.app-token.outputs.token }}"

- name: CLA Assistant
if: ${{ (contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' }}
uses: SiliconLabsSoftware/action-cla-assistant@silabs_flavour_v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
with:
path-to-signatures: ${{ inputs.signatures_path }}
path-to-document: ${{ inputs.document_url }}
branch: ${{ inputs.branch }}
allowlist: ${{ inputs.allowlist }}
remote-organization-name: ${{ inputs.remote_org }}
remote-repository-name: ${{ inputs.remote_repo }}
create-file-commit-message: "Created the CLA database file. CLA Assistant Lite bot created this file."
signed-commit-message: "$contributorName has signed the CLA in $owner/$repo#$pullRequestNo"
Loading