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

feat: make LFS checkout optional #260

Merged
merged 1 commit into from
Sep 27, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/docker_repo_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
# This is a docker image that mimics the github runner image
# https://github.com/catthehacker/docker_images/pkgs/container/ubuntu
container: catthehacker/ubuntu:runner-20.04
container: ghcr.io/catthehacker/ubuntu:runner-20.04
strategy:
fail-fast: false
matrix:
Expand Down
17 changes: 15 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ inputs:
required: false
default: false

lfs-checkout:
description: Option to checkout LFS files
required: false
default: true

runs:
using: composite
steps:
Expand All @@ -124,9 +129,15 @@ runs:
GITHUB_TOKEN=${{ github.token }}
EOF

# First arg is field to fetch, second arg is default value or empty
payload() {
if [ $# -lt 2 ]; then
DEFAULT_VALUE=empty
else
DEFAULT_VALUE=\"$2\"
fi
if command -v jq >/dev/null; then
jq -r ".inputs.payload | fromjson | .$1 // empty" ${TEST_GITHUB_EVENT_PATH:-${GITHUB_EVENT_PATH}}
jq -r ".inputs.payload | fromjson | .$1 // ${DEFAULT_VALUE}" ${TEST_GITHUB_EVENT_PATH:-${GITHUB_EVENT_PATH}}
else
echo "::error::jq not installed on system!"
exit 1
Expand Down Expand Up @@ -174,6 +185,7 @@ runs:
INPUT_UPLOAD_SERIES=$(payload uploadSeries)
INPUT_UPLOAD_ID=$(payload uploadId)
INPUT_AUTOFIX_AND_PUSH=$(payload autofixAndPush)
INPUT_LFS_CHECKOUT=$(payload lfsCheckout true)
EOF

else
Expand Down Expand Up @@ -208,6 +220,7 @@ runs:
INPUT_UPLOAD_SERIES=${{ inputs.upload-series }}
INPUT_UPLOAD_ID=
INPUT_AUTOFIX_AND_PUSH=
INPUT_LFS_CHECKOUT=${{ inputs.lfs-checkout }}
EOF

fi
Expand All @@ -216,7 +229,7 @@ runs:
if: env.INPUT_TARGET_CHECKOUT
uses: actions/checkout@v3
with:
lfs: true
lfs: ${{ env.INPUT_LFS_CHECKOUT && inputs.lfs-checkout }}
submodules: recursive
repository: ${{ env.INPUT_TARGET_CHECKOUT }}
ref: ${{ env.INPUT_TARGET_CHECKOUT_REF }}
Expand Down
Loading