Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(checkout): check out correct fork/branch during PR CI run #1173

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci-jobs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
on:
workflow_call:
inputs:
checkout-repo:
required: false
type: string
checkout-ref:
required: false
type: string
outputs:
image-version:
description: the Cryostat application version that will be built
Expand All @@ -10,6 +17,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
- id: query-pom
name: Get properties from POM
# Query POM for core and image version and save as output parameter
Expand Down Expand Up @@ -52,6 +62,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
submodules: true
fetch-depth: 0
- uses: actions/setup-java@v2
Expand Down Expand Up @@ -84,6 +96,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
submodules: true
fetch-depth: 0
- uses: actions/setup-java@v2
Expand Down Expand Up @@ -111,6 +125,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
- name: Run spotless
run: mvn spotless:check

Expand All @@ -119,6 +136,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
submodules: true
fetch-depth: 0
- uses: skjolber/maven-cache-github-action@v1
Expand All @@ -135,5 +154,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
- name: Run shellcheck
run: mvn shellcheck:check
3 changes: 3 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
jobs:
build-and-test:
uses: ./.github/workflows/ci-jobs.yml
with:
checkout-repo: ${{ github.repository }}
checkout-ref: ${{ github.event.pull_request.head.ref }}
if: github.repository_owner == 'cryostatio' && contains(github.event.pull_request.labels.*.name, 'safe-to-test')

push-to-ghcr:
Expand Down