Skip to content

Commit 8d48a1d

Browse files
committed
iterating cla automation
1 parent 71abf30 commit 8d48a1d

File tree

3 files changed

+78
-77
lines changed

3 files changed

+78
-77
lines changed

.github/workflows/cla-workflow.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Reusable CLA Workflow
2+
# Called by other repositories to check CLA signatures
3+
#
4+
# Usage in other repos:
5+
# jobs:
6+
# cla:
7+
# uses: netfoundry/cla/.github/workflows/cla-workflow.yml@main
8+
# secrets: inherit
9+
10+
name: "CLA Workflow"
11+
12+
on:
13+
workflow_call:
14+
secrets:
15+
CLA_APP_ID:
16+
required: true
17+
CLA_APP_PRIVATE_KEY:
18+
required: true
19+
20+
jobs:
21+
CLAAssistant:
22+
runs-on: ubuntu-latest
23+
# Skip CLA check for org members/owners (they're covered by employment agreement)
24+
# But always run for issue_comment events (to process signatures)
25+
if: |
26+
github.event_name == 'issue_comment' ||
27+
(github.event_name == 'pull_request_target' &&
28+
github.event.pull_request.author_association != 'MEMBER' &&
29+
github.event.pull_request.author_association != 'OWNER')
30+
steps:
31+
- name: Debug - Workflow Version
32+
run: echo "CLA Workflow v3 - Reusable workflow with GitHub App auth (2026-02-04)"
33+
34+
- name: Generate GitHub App Token
35+
id: app-token
36+
uses: actions/create-github-app-token@v1
37+
with:
38+
app-id: ${{ secrets.CLA_APP_ID }}
39+
private-key: ${{ secrets.CLA_APP_PRIVATE_KEY }}
40+
owner: netfoundry
41+
repositories: cla
42+
43+
- name: Debug - Token Generated
44+
run: |
45+
if [ -n "${{ steps.app-token.outputs.token }}" ]; then
46+
echo "Token generated successfully (length: ${#TOKEN})"
47+
else
48+
echo "ERROR: Token is empty - check GitHub App setup and secrets"
49+
fi
50+
env:
51+
TOKEN: ${{ steps.app-token.outputs.token }}
52+
53+
- name: "CLA Assistant"
54+
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'
55+
uses: contributor-assistant/github-action@v2.6.1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
59+
with:
60+
path-to-signatures: 'signatures/cla.json'
61+
path-to-document: 'https://netfoundry.io/docs/assets/files/NetFoundry-ICLA-32974791ae564dd1878a7d2ab1ab8d5e.pdf'
62+
branch: 'main'
63+
allowlist: dependabot[bot],renovate[bot],github-actions[bot],bot*
64+
remote-organization-name: netfoundry
65+
remote-repository-name: cla

.github/workflows/cla.yml

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
# CLA Check for this repository
2+
# Uses the reusable workflow defined in cla-workflow.yml
3+
14
name: "CLA Assistant"
5+
26
on:
37
issue_comment:
48
types: [created]
@@ -12,45 +16,6 @@ permissions:
1216
statuses: write
1317

1418
jobs:
15-
CLAAssistant:
16-
runs-on: ubuntu-latest
17-
# Skip CLA check for org members/owners (they're covered by employment agreement)
18-
# But always run for issue_comment events (to process signatures)
19-
if: |
20-
github.event_name == 'issue_comment' ||
21-
(github.event_name == 'pull_request_target' &&
22-
github.event.pull_request.author_association != 'MEMBER' &&
23-
github.event.pull_request.author_association != 'OWNER')
24-
steps:
25-
- name: Debug - Workflow Version
26-
run: echo "CLA Workflow v2 - Using GitHub App authentication (2026-02-04)"
27-
28-
- name: Generate GitHub App Token
29-
id: app-token
30-
uses: actions/create-github-app-token@v1
31-
with:
32-
app-id: ${{ secrets.CLA_APP_ID }}
33-
private-key: ${{ secrets.CLA_APP_PRIVATE_KEY }}
34-
35-
- name: Debug - Token Generated
36-
run: |
37-
if [ -n "${{ steps.app-token.outputs.token }}" ]; then
38-
echo "Token generated successfully (length: ${#TOKEN})"
39-
else
40-
echo "ERROR: Token is empty - check GitHub App setup and secrets"
41-
fi
42-
env:
43-
TOKEN: ${{ steps.app-token.outputs.token }}
44-
45-
- name: "CLA Assistant"
46-
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'
47-
uses: contributor-assistant/github-action@v2.6.1
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
51-
with:
52-
path-to-signatures: 'signatures/cla.json'
53-
path-to-document: 'https://netfoundry.io/docs/assets/files/NetFoundry-ICLA-32974791ae564dd1878a7d2ab1ab8d5e.pdf'
54-
branch: 'main'
55-
allowlist: dependabot[bot],renovate[bot],github-actions[bot],bot*
56-
lock-pullrequest-aftermerge: false
19+
cla:
20+
uses: netfoundry/cla/.github/workflows/cla-workflow.yml@main
21+
secrets: inherit

workflow-template/cla.yml

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# Copy this file to .github/workflows/cla.yml in any repository that should
44
# require CLA signatures from contributors.
55
#
6-
# REQUIRED: Add CLA_APP_ID and CLA_APP_PRIVATE_KEY as organization secrets.
7-
# These should be from a GitHub App with Contents (read/write) access
8-
# to the netfoundry/cla repository.
6+
# REQUIRED: Add CLA_APP_ID and CLA_APP_PRIVATE_KEY as organization secrets
7+
# accessible to this repository.
98

109
name: "CLA Check"
10+
1111
on:
1212
issue_comment:
1313
types: [created]
@@ -21,35 +21,6 @@ permissions:
2121
statuses: write
2222

2323
jobs:
24-
CLAAssistant:
25-
runs-on: ubuntu-latest
26-
# Skip CLA check for org members/owners (they're covered by employment agreement)
27-
# But always run for issue_comment events (to process signatures)
28-
if: |
29-
github.event_name == 'issue_comment' ||
30-
(github.event_name == 'pull_request_target' &&
31-
github.event.pull_request.author_association != 'MEMBER' &&
32-
github.event.pull_request.author_association != 'OWNER')
33-
steps:
34-
- name: Generate GitHub App Token
35-
id: app-token
36-
uses: actions/create-github-app-token@v1
37-
with:
38-
app-id: ${{ secrets.CLA_APP_ID }}
39-
private-key: ${{ secrets.CLA_APP_PRIVATE_KEY }}
40-
owner: netfoundry
41-
repositories: cla
42-
43-
- name: "CLA Assistant"
44-
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'
45-
uses: contributor-assistant/github-action@v2.6.1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
49-
with:
50-
path-to-signatures: 'signatures/cla.json'
51-
path-to-document: 'https://netfoundry.io/docs/assets/files/NetFoundry-ICLA-32974791ae564dd1878a7d2ab1ab8d5e.pdf'
52-
branch: 'main'
53-
allowlist: dependabot[bot],renovate[bot],github-actions[bot],bot*
54-
remote-organization-name: 'netfoundry'
55-
remote-repository-name: 'cla'
24+
cla:
25+
uses: netfoundry/cla/.github/workflows/cla-workflow.yml@main
26+
secrets: inherit

0 commit comments

Comments
 (0)