Skip to content

Commit

Permalink
Allow to checkout a different repo than your own
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Oct 17, 2024
1 parent 0663467 commit 338a43c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ on:
maven-args:
description: Additional Maven arguments
type: string
ref:
description: The branch, tag or SHA to checkout
# When running on `pull_request_target` use the PR branch, not the target branch
default: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
type: string
repository:
description: GitHub repository name with owner
default: ${{ github.repository }}
type: string
reproducibility-check-enabled:
description: Runs a reproducibility check on the build
default: true
Expand Down Expand Up @@ -64,8 +73,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # 4.2.1
with:
# When running on `pull_request` use the PR branch, not the target branch
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Set up Java
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # 4.4.0
Expand Down

0 comments on commit 338a43c

Please sign in to comment.