Check for formatting errors on refs/pull/37464/merge #21460
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check for formatting errors | |
run-name: Check for formatting errors on ${{ github.ref }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
format-check: | |
# IMPORTANT: This name must match the require check name on the branch protection settings | |
name: "Check for formatting errors" | |
# Do not run this job on forks | |
# Forked PRs are handled by the community_ci.yml workflow | |
if: github.event.pull_request.head.repo.fork != true | |
runs-on: tooling-test-small | |
steps: | |
- name: Checkout Airbyte (with credentials) | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GH_PAT_APPROVINGTON_OCTAVIA }} | |
fetch-depth: 1 | |
- name: Run airbyte-ci format check [MASTER] | |
id: airbyte_ci_format_check_all_master | |
if: github.ref == 'refs/heads/master' | |
uses: ./.github/actions/run-airbyte-ci | |
continue-on-error: true | |
with: | |
context: "master" | |
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN_2 }} | |
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }} | |
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }} | |
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | |
subcommand: "format check all" | |
- name: Run airbyte-ci format check [PULL REQUEST] | |
id: airbyte_ci_format_check_all_pr | |
if: github.event_name == 'pull_request' | |
uses: ./.github/actions/run-airbyte-ci | |
continue-on-error: false | |
with: | |
context: "pull_request" | |
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN_2 }} | |
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }} | |
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }} | |
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | |
subcommand: "format check all" | |
- name: Run airbyte-ci format check [WORKFLOW DISPATCH] | |
id: airbyte_ci_format_check_all_manual | |
if: github.event_name == 'workflow_dispatch' | |
uses: ./.github/actions/run-airbyte-ci | |
continue-on-error: false | |
with: | |
context: "manual" | |
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN_2 }} | |
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }} | |
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }} | |
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | |
subcommand: "format check all" | |
- name: Match GitHub User to Slack User [MASTER] | |
if: github.ref == 'refs/heads/master' | |
id: match-github-to-slack-user | |
uses: ./.github/actions/match-github-to-slack-user | |
env: | |
AIRBYTE_TEAM_BOT_SLACK_TOKEN: ${{ secrets.SLACK_AIRBYTE_TEAM_READ_USERS }} | |
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Format Failure on Master Slack Channel [MASTER] | |
if: steps.airbyte_ci_format_check_all.outcome == 'failure' && github.ref == 'refs/heads/master' | |
uses: abinoda/slack-action@master | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }} | |
with: | |
args: >- | |
{\"channel\":\"C03BEADRPNY\", \"blocks\":[ | |
{\"type\":\"divider\"}, | |
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Formatting is broken on master! :bangbang: \n\n\"}}, | |
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"_merged by_: *${{ github.actor }}* \n\"}}, | |
{\"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\"}]} | |
# TODO alafanechere: move it to community_ci.yml and make it use the run-airbyte-ci action | |
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 (Unprivileged) | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
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 |