Skip to content

Commit f9a6acb

Browse files
authored
gradle.yml: make it run on forks (#37788)
1 parent f0a4628 commit f9a6acb

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.github/workflows/gradle.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,17 @@ jobs:
5252
name: Gradle Check
5353
timeout-minutes: 30
5454
steps:
55-
# The run-check job will be triggered if a fork made changes to gradle projects.
56-
# We don't want forks to make changes to gradle projects.
57-
# So we fail the job if the PR is from a fork, it will make the required CI check fail.
58-
- name: Check if PR is from a fork
59-
id: check-if-pr-is-from-fork
60-
if: github.event_name == 'pull_request'
61-
shell: bash
62-
run: |
63-
if [ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]; then
64-
echo "PR is from a fork. Exiting workflow..."
65-
exit 78
66-
fi
6755
- name: Checkout Airbyte
6856
uses: actions/checkout@v4
6957
- uses: actions/setup-java@v3
7058
with:
7159
distribution: "zulu"
7260
java-version: "21"
7361
- name: Docker login
74-
# Some tests use testcontainers which pull images from DockerHub.
75-
uses: docker/login-action@v1
62+
# We login to benefit from increased rate limits for docker pulls
63+
# We can't do it on forks as pull_requests events on forks do not have access to GH secrets
64+
if: github.event.pull_request.head.repo.fork != true
65+
uses: docker/login-action@v3
7666
with:
7767
username: ${{ secrets.DOCKER_HUB_USERNAME }}
7868
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
@@ -148,7 +138,7 @@ jobs:
148138
runs-on: ubuntu-latest
149139
needs:
150140
- run-check
151-
if: success()
141+
if: ${{ success() && github.event.pull_request.head.repo.fork != true }}
152142
steps:
153143
- name: Get Previous Workflow Status
154144
uses: Mercymeilya/[email protected]

0 commit comments

Comments
 (0)