Skip to content

Commit

Permalink
CI: Add version of format-checks which can run on forks (#37356)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Apr 23, 2024
1 parent 5f29e8f commit 68a8c70
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
format-check:
# IMPORTANT: This name must match the require check name on the branch protection settings
name: "Check for formatting errors"
if: >
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event.pull_request.head.repo.fork == false)
runs-on: tooling-test-small
steps:
- name: Checkout Airbyte
Expand Down Expand Up @@ -87,3 +90,33 @@ jobs:
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"<@${{ steps.match-github-to-slack-user.outputs.slack_user_ids }}> \n\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\" :octavia-shocked: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run> :octavia-shocked: \n\"}},
{\"type\":\"divider\"}]}
format-check-from-forks:
# Same-named job as above, in order to ensure 'required checks' pass either way.
# This should run all the same checks as above, except not requiring any credentials.
name: "Check for formatting errors"
if: >
github.event.pull_request.head.repo.fork == true
runs-on: ubuntu-latest
steps:
# We have no creds. Ignore docker caching and just run the CLI.
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Airbyte CI from binary
id: install-airbyte-ci-binary
shell: bash
run: |
curl -sSL "https://connectors.airbyte.com/airbyte-ci/releases/ubuntu/latest/airbyte-ci" --output airbyte-ci-bin
sudo mv airbyte-ci-bin /usr/local/bin/airbyte-ci
sudo chmod +x /usr/local/bin/airbyte-ci
- name: Run format checks
run: |
/usr/local/bin/airbyte-ci format check all

0 comments on commit 68a8c70

Please sign in to comment.