Skip to content

Commit fca7cbe

Browse files
authored
chore(IDX): remove CLA dev workflow (#105)
* remove dev workflow * update comment * rename
1 parent 29416e2 commit fca7cbe

File tree

4 files changed

+85
-107
lines changed

4 files changed

+85
-107
lines changed

.github/workflows/check_cla.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/check_cla_dev.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/check_cla_ruleset.yml

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,89 @@ on:
1010
- 'master'
1111
- 'main'
1212
merge_group:
13-
1413
jobs:
15-
call-check-cla:
16-
uses: dfinity/public-workflows/.github/workflows/check_cla.yml@main
14+
check-membership:
15+
uses: dfinity/public-workflows/.github/workflows/check_membership.yml@main
1716
secrets: inherit
17+
18+
check-external-contributions:
19+
name: Check External Contributions
20+
runs-on: ubuntu-latest
21+
needs: check-membership
22+
if: ${{ needs.check-membership.outputs.is_member != 'true' && needs.check-membership.result == 'success' }}
23+
steps:
24+
- name: Create GitHub App Token
25+
uses: actions/create-github-app-token@v1
26+
id: app-token
27+
with:
28+
app-id: ${{ vars.CLA_BOT_APP_ID }}
29+
private-key: ${{ secrets.CLA_BOT_PRIVATE_KEY }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
repository: 'dfinity/public-workflows'
35+
36+
- name: Python Setup
37+
uses: ./.github/workflows/python-setup
38+
39+
- name: Check if accepting external contributions
40+
id: accepts_external_contrib
41+
run: |
42+
export PYTHONPATH="$PWD/reusable_workflows/"
43+
python reusable_workflows/check_membership/check_external_contrib.py
44+
shell: bash
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
REPO: ${{ github.event.repository.name }}
48+
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.event.pull_request.head.ref }}
53+
repository: ${{ github.event.pull_request.head.repo.full_name }}
54+
55+
- name: Close Pull Request
56+
id: close_pr
57+
if: ${{ steps.accepts_external_contrib.outputs.accepts_contrib != 'true' }}
58+
uses: superbrothers/close-pull-request@v3
59+
with:
60+
comment: |
61+
Thank you for contributing! Unfortunately this repository does not accept external contributions yet.
62+
63+
We are working on enabling this by aligning our internal processes and our CI setup to handle external contributions. However this will take some time to set up so in the meantime we unfortunately have to close this Pull Request.
64+
65+
We hope you understand and will come back once we accept external PRs.
66+
67+
— The DFINITY Foundation"""
68+
69+
- name: Add Label
70+
uses: actions/github-script@v6
71+
if: ${{ steps.accepts_external_contrib.outputs.accepts_contrib != 'false' }}
72+
with:
73+
script: |
74+
github.rest.issues.addLabels({
75+
issue_number: context.issue.number,
76+
owner: context.repo.owner,
77+
repo: context.repo.repo,
78+
labels: ["external-contributor"]
79+
})
80+
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
if: ${{ steps.accepts_external_contrib.outputs.accepts_contrib != 'false' }}
84+
with:
85+
repository: 'dfinity/public-workflows'
86+
87+
- name: Check CLA
88+
id: check-cla
89+
run: |
90+
export PYTHONPATH="$PWD/reusable_workflows/"
91+
python reusable_workflows/check_cla/check_cla_pr.py
92+
shell: bash
93+
if: ${{ steps.accepts_external_contrib.outputs.accepts_contrib != 'false' }}
94+
env:
95+
GH_ORG: ${{ github.repository_owner }}
96+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
97+
REPO: ${{ github.event.repository.name }}
98+
PR_ID: ${{ github.event.number }}

.github/workflows/check_cla_signed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
name: Check Issue Signed
44

5+
# this workflow is triggered from the repo https://github.com/dfinity/cla
56
on:
67
workflow_call:
78

0 commit comments

Comments
 (0)