forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (99 loc) · 5.22 KB
/
format_check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Check for formatting errors
run-name: Check for formatting errors on ${{ github.ref }}
on:
workflow_dispatch:
inputs:
airbyte-ci-binary-url:
description: "URL to airbyte-ci binary"
required: false
# Pin to a specific version of airbyte-ci to avoid transient failures
# Mentioned in issue https://github.com/airbytehq/airbyte/issues/34041
default: https://connectors.airbyte.com/airbyte-ci/releases/ubuntu/2.14.1/airbyte-ci
push:
branches:
- master
pull_request:
jobs:
format-check:
runs-on: "ci-runner-connector-format-medium-dagger-0-6-4"
# IMPORTANT: This name must match the require check name on the branch protection settings
name: "Check for formatting errors"
steps:
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT_APPROVINGTON_OCTAVIA }}
- name: Run airbyte-ci format check [MASTER]
id: airbyte_ci_format_check_all_master
if: github.ref == 'refs/heads/master'
uses: ./.github/actions/run-dagger-pipeline
continue-on-error: true
with:
context: "master"
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
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 }}
tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }}
subcommand: "format check all"
# Pin to a specific version of airbyte-ci to avoid transient failures
# Mentioned in issue https://github.com/airbytehq/airbyte/issues/34041
airbyte_ci_binary_url: https://connectors.airbyte.com/airbyte-ci/releases/ubuntu/2.14.1/airbyte-ci
- 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-dagger-pipeline
continue-on-error: false
with:
context: "pull_request"
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
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 }}
tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }}
subcommand: "format check all"
# Pin to a specific version of airbyte-ci to avoid transient failures
# Mentioned in issue https://github.com/airbytehq/airbyte/issues/34041
airbyte_ci_binary_url: https://connectors.airbyte.com/airbyte-ci/releases/ubuntu/2.14.1/airbyte-ci
- 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-dagger-pipeline
continue-on-error: false
with:
context: "manual"
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
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 }}
tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }}
subcommand: "format check all"
airbyte_ci_binary_url: ${{ github.event.inputs.airbyte-ci-binary-url }}
- 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\"}]}