Skip to content

Commit

Permalink
gradle.yml: make it run on forks (#37788)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere authored May 3, 2024
1 parent f0a4628 commit f9a6acb
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,17 @@ jobs:
name: Gradle Check
timeout-minutes: 30
steps:
# The run-check job will be triggered if a fork made changes to gradle projects.
# We don't want forks to make changes to gradle projects.
# So we fail the job if the PR is from a fork, it will make the required CI check fail.
- name: Check if PR is from a fork
id: check-if-pr-is-from-fork
if: github.event_name == 'pull_request'
shell: bash
run: |
if [ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]; then
echo "PR is from a fork. Exiting workflow..."
exit 78
fi
- name: Checkout Airbyte
uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- name: Docker login
# Some tests use testcontainers which pull images from DockerHub.
uses: docker/login-action@v1
# We login to benefit from increased rate limits for docker pulls
# We can't do it on forks as pull_requests events on forks do not have access to GH secrets
if: github.event.pull_request.head.repo.fork != true
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
Expand Down Expand Up @@ -148,7 +138,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- run-check
if: success()
if: ${{ success() && github.event.pull_request.head.repo.fork != true }}
steps:
- name: Get Previous Workflow Status
uses: Mercymeilya/[email protected]
Expand Down

0 comments on commit f9a6acb

Please sign in to comment.