Skip to content

Commit

Permalink
Merge pull request #35 from secondlife/signal/shallow
Browse files Browse the repository at this point in the history
Add shallow option to perform depth: 1 checkout
  • Loading branch information
bennettgoble authored Apr 8, 2024
2 parents db2adfd + a4fc7cb commit 2af2781
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ inputs:
artifact-name:
type: string
description: Name of artifact to upload, defaults to the autobuild package name
shallow:
type: boolean
description: Use shallow clone
default: false

outputs:
package-name:
Expand All @@ -87,18 +91,18 @@ runs:
steps:
- name: Disable autocrlf
shell: bash
env:
WINDOWS: ${{ runner.os == 'Windows' }}
run: |
if [[ $WINDOWS == 'true' ]]; then
git config --global core.autocrlf input
fi
if: runner.os == 'Windows'
run: git config --global core.autocrlf input

- name: Checkout
uses: actions/checkout@v4
if: inputs.checkout
with:
fetch-depth: 0 # Fetch all history for SCM version
# Work around the fact that in the context of a pull request github.sha
# references a dynamic merge commit rather than the branch head
# https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: ${{ fromJSON(inputs.shallow) && 1 || 0 }} # Fetch all history for SCM version
submodules: recursive

- name: Create short SHA
Expand Down

0 comments on commit 2af2781

Please sign in to comment.