Skip to content

Commit

Permalink
fix: allow review requirements check on forks (#44404)
Browse files Browse the repository at this point in the history
  • Loading branch information
erohmensing authored Aug 23, 2024
1 parent 78cbcf4 commit c7a6731
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/community_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,60 @@ jobs:
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
subcommand: "format check all"
is_fork: "true"

check-review-requirements:
name: Check if a review is required from Connector teams on fork
if: github.event.pull_request.head.repo.fork == true
environment: community-ci-auto
runs-on: community-tooling-test-small
needs: fail_on_protected_path_changes
timeout-minutes: 10
env:
MAIN_BRANCH_NAME: "master"
permissions:
pull-requests: write
steps:
# This checkouts a fork which can contain untrusted code
# It's deemed safe as the review required check is not executing any checked out code
- name: Checkout fork
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
# This will sync the .github folder of the main repo with the fork
# This allows us to use up to date actions and CI logic from the main repo
- name: Pull .github folder from main repository
id: pull_github_folder
run: |
git remote add main https://github.com/airbytehq/airbyte.git
git fetch main ${MAIN_BRANCH_NAME}
git checkout main/${MAIN_BRANCH_NAME} -- .github
git checkout main/${MAIN_BRANCH_NAME} -- airbyte-ci
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install ci-connector-ops package
run: |
pip install pipx
pipx ensurepath
pipx install airbyte-ci/connectors/connector_ops
- name: Write review requirements file
id: write-review-requirements-file
run: write-review-requirements-file >> $GITHUB_OUTPUT
- name: Get mandatory reviewers
id: get-mandatory-reviewers
run: print-mandatory-reviewers >> $GITHUB_OUTPUT
- name: Check if the review requirements are met
if: steps.write-review-requirements-file.outputs.CREATED_REQUIREMENTS_FILE == 'true'
uses: Automattic/action-required-review@v3
with:
status: ${{ steps.get-mandatory-reviewers.outputs.MANDATORY_REVIEWERS }}
token: ${{ secrets.OCTAVIA_4_ROOT_ACCESS }}
request-reviews: true
requirements-file: .github/connector_org_review_requirements.yaml

connectors_early_ci:
name: Run connectors early CI on fork
if: github.event.pull_request.head.repo.fork == true
Expand Down

0 comments on commit c7a6731

Please sign in to comment.