From 41e894b5c6f30bb17906959f5404c3330aab1d3a Mon Sep 17 00:00:00 2001 From: Brendan Lafond <85505422+brendanlafond@users.noreply.github.com> Date: Fri, 22 Sep 2023 02:29:12 -0400 Subject: [PATCH] #58 New feature to support repository and token options (#59) --- README.md | 14 ++++++++------ action.yml | 12 ++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f4d2c2a..8e219cf 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,14 @@ For default values you only need: ## checkout -| params | destination | default | -|------------------------------|---------------------|---------| -| checkout-fetch-depth | fetch-depth | | -| checkout-path | path | | -| checkout-ref | ref | | -| checkout-persist-credentials | persist-credentials | false | +| params | destination | default | +|------------------------------|---------------------|--------------------------| +| checkout-fetch-depth | fetch-depth | | +| checkout-path | path | | +| checkout-ref | ref | | +| checkout-repository | repository | ${{ github.repository }} | +| checkout-token | token | ${{ github.token }} | +| checkout-persist-credentials | persist-credentials | false | ## setup-java diff --git a/action.yml b/action.yml index 3f73b29..2807aa7 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,16 @@ inputs: description: 'The branch, tag, or SHA of the repository to clone' required: false + checkout-repository: + description: 'The repository to checkout if not the repository that triggered the action. For use when building GitHub Apps' + required: false + default: ${{ github.repository }} + + checkout-token: + description: 'Token to use for checkout if checking out a repository out of scope for GITHUB_TOKEN' + required: false + default: ${{ github.token }} + # java jdk params java-version: @@ -85,6 +95,8 @@ runs: path: '${{ inputs.checkout-path }}' persist-credentials: '${{ inputs.checkout-persist-credentials }}' ref: '${{ inputs.checkout-ref }}' + repository: '${{ inputs.checkout-repository }}' + token: '${{ inputs.checkout-token }}' - uses: actions/setup-java@v3 with: