File tree Expand file tree Collapse file tree 7 files changed +21
-265
lines changed
Expand file tree Collapse file tree 7 files changed +21
-265
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,10 @@ permissions:
1515 pull-requests : write
1616
1717jobs :
18- check-membership :
19- uses : dfinity/public-workflows/.github/workflows/check_membership.yml@main
20- secrets : inherit
21-
2218 check-external-contributions :
2319 name : Check External Contributions
2420 runs-on : ubuntu-latest
25- needs : check-membership
26- if : ${{ needs.check-membership.outputs.is_member != 'true' && needs.check-membership.result == 'success' }}
21+ if : github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
2722 steps :
2823 - name : Create GitHub App Token
2924 uses : actions/create-github-app-token@v1
4439 id : accepts_external_contrib
4540 run : |
4641 export PYTHONPATH="$PWD/reusable_workflows/"
47- python reusable_workflows/check_membership/check_external_contrib .py
42+ python reusable_workflows/check_cla/check_repos .py
4843 shell : bash
4944 env :
5045 GH_TOKEN : ${{ steps.app-token.outputs.token }}
Load Diff This file was deleted.
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import os
22
3- from check_membership .check_membership import is_approved_bot
3+ APPROVED_BOT_LIST = [
4+ "dependabot[bot]" ,
5+ "dfinity-bot" ,
6+ "github-actions[bot]" ,
7+ "gix-bot" ,
8+ "mergify[bot]" ,
9+ "pr-automation-bot-public[bot]" ,
10+ "pr-creation-bot-dfinity-ic[bot]" ,
11+ "pr-creation-bot-dfinity[bot]" ,
12+ "sa-github-api" ,
13+ ]
14+
15+ def is_approved_bot (user : str ) -> bool :
16+ """
17+ Return whether the user is an approved bot.
18+ """
19+ return user in APPROVED_BOT_LIST
420
521
622def main () -> None :
7- user = os .getenv ( "USER" )
23+ user = os .environ [ "USER" ]
824
925 is_bot = is_approved_bot (user )
1026 os .system (f"""echo 'is_bot={ is_bot } ' >> $GITHUB_OUTPUT""" )
Original file line number Diff line number Diff line change 44import github3
55import pytest
66
7- from check_membership . check_external_contrib import (
7+ from check_cla . check_repos import (
88 get_repos_open_to_contributions ,
99 main ,
1010) # noqa
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments