Skip to content

Commit

Permalink
connectors-ci: early exit when no connector changes (#35578)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere authored and xiaohansong committed Feb 27, 2024
1 parent 138f500 commit a2e4666
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/connectors_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,45 @@ on:
- opened
- synchronize
jobs:
changes:
runs-on: ubuntu-latest
outputs:
connectors: ${{ steps.changes.outputs.connectors }}
permissions:
statuses: write
steps:
- name: Checkout Airbyte
if: github.event_name != 'pull_request'
uses: actions/checkout@v3
- id: changes
uses: dorny/paths-filter@v2
with:
# Note: expressions within a filter are OR'ed
filters: |
connectors:
- '*'
- 'airbyte-ci/**/*'
- 'airbyte-integrations/connectors/**/*'
- 'airbyte-cdk/**/*'
- 'buildSrc/**/*'
# The Connector CI Tests is a status check emitted by airbyte-ci
# We make it pass once we have determined that there are no changes to the connectors
- name: "Skip Connectors CI tests"
if: steps.changes.outputs.connectors != 'true' && github.event_name == 'pull_request'
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "success",
"context": "Connectors CI tests",
"target_url": "${{ github.event.workflow_run.html_url }}"
}' \
connectors_ci:
needs: changes
if: needs.changes.outputs.connectors == 'true'
name: Connectors CI
runs-on: connector-test-large
timeout-minutes: 1440 # 24 hours
Expand Down

0 comments on commit a2e4666

Please sign in to comment.