-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gradle.yml: make it run on forks (#37788)
- Loading branch information
1 parent
f0a4628
commit f9a6acb
Showing
1 changed file
with
5 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -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] | ||
|