Skip to content

Commit 88274b2

Browse files
alafanecherejatinyadav-cc
authored andcommitted
connectors-ci: early exit when no connector changes (airbytehq#35578)
1 parent 121e2bb commit 88274b2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/connectors_tests.yml

+38
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,45 @@ on:
2222
- opened
2323
- synchronize
2424
jobs:
25+
changes:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
connectors: ${{ steps.changes.outputs.connectors }}
29+
permissions:
30+
statuses: write
31+
steps:
32+
- name: Checkout Airbyte
33+
if: github.event_name != 'pull_request'
34+
uses: actions/checkout@v3
35+
- id: changes
36+
uses: dorny/paths-filter@v2
37+
with:
38+
# Note: expressions within a filter are OR'ed
39+
filters: |
40+
connectors:
41+
- '*'
42+
- 'airbyte-ci/**/*'
43+
- 'airbyte-integrations/connectors/**/*'
44+
- 'airbyte-cdk/**/*'
45+
- 'buildSrc/**/*'
46+
# The Connector CI Tests is a status check emitted by airbyte-ci
47+
# We make it pass once we have determined that there are no changes to the connectors
48+
- name: "Skip Connectors CI tests"
49+
if: steps.changes.outputs.connectors != 'true' && github.event_name == 'pull_request'
50+
run: |
51+
curl --request POST \
52+
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
53+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
54+
--header 'content-type: application/json' \
55+
--data '{
56+
"state": "success",
57+
"context": "Connectors CI tests",
58+
"target_url": "${{ github.event.workflow_run.html_url }}"
59+
}' \
60+
2561
connectors_ci:
62+
needs: changes
63+
if: needs.changes.outputs.connectors == 'true'
2664
name: Connectors CI
2765
runs-on: connector-test-large
2866
timeout-minutes: 1440 # 24 hours

0 commit comments

Comments
 (0)