Skip to content

Commit

Permalink
feat(IDX): reuse check-membership workflow (#104)
Browse files Browse the repository at this point in the history
* Revert "Revert "feat(IDX): reuse check-membership workflow (#102)" (#103)"

This reverts commit ff8baea.

* Update check_cla_ruleset.yml

* Update check_cla.yml

* Update internal_vs_external.yml
  • Loading branch information
cgundy authored Jan 27, 2025
1 parent ff8baea commit 29416e2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 60 deletions.
32 changes: 2 additions & 30 deletions .github/workflows/check_cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,8 @@ on:

jobs:
check-membership:
name: Check Membership
runs-on: ubuntu-latest
# Dont run this workflow on merge queue
if: ${{ github.event_name != 'merge_group' }}
outputs:
is_member: ${{ steps.check-membership.outputs.is_member}}
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.CLA_BOT_APP_ID }}
private-key: ${{ secrets.CLA_BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
repository: 'dfinity/public-workflows'

- name: Python Setup
uses: ./.github/workflows/python-setup

- name: Check Membership
id: check-membership
run: python reusable_workflows/check_membership/check_membership.py
shell: bash
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
uses: dfinity/public-workflows/.github/workflows/check_membership.yml@main
secrets: inherit

check-external-contributions:
name: Check External Contributions
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/check_membership.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Workflow to check if a user is a member of the org

name: Check Membership

on:
workflow_call:
outputs:
is_member:
value: ${{ jobs.check-membership.outputs.is_member }}

jobs:
check-membership:
name: Check Membership
runs-on: ubuntu-latest
# Dont run this workflow on merge queue
if: ${{ github.event_name != 'merge_group' }}
outputs:
is_member: ${{ steps.check-membership.outputs.is_member}}
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.CLA_BOT_APP_ID }}
private-key: ${{ secrets.CLA_BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
repository: 'dfinity/public-workflows'

- name: Python Setup
uses: ./.github/workflows/python-setup

- name: Check Membership
id: check-membership
run: python reusable_workflows/check_membership/check_membership.py
shell: bash
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
32 changes: 2 additions & 30 deletions .github/workflows/internal_vs_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,8 @@ permissions:

jobs:
check-membership:
name: Check Membership
runs-on: ubuntu-latest
# Dont run this workflow on merge queue
if: ${{ github.event_name != 'merge_group' }}
outputs:
is_member: ${{ steps.check-membership.outputs.is_member}}
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.CLA_BOT_APP_ID }}
private-key: ${{ secrets.CLA_BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
repository: 'dfinity/public-workflows'

- name: Python Setup
uses: ./.github/workflows/python-setup

- name: Check Membership
id: check-membership
run: python reusable_workflows/check_membership/check_membership.py
shell: bash
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
uses: dfinity/public-workflows/.github/workflows/check_membership.yml@main
secrets: inherit

revoke-approvals:
name: Revoke Approvals
Expand Down

0 comments on commit 29416e2

Please sign in to comment.