Skip to content

Commit

Permalink
fix: add dynamic LFS workaround repo path
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro-mariotti-zupit committed Nov 9, 2023
1 parent 9914f43 commit 2a0fa65
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/django-step-lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
required: false
type: boolean
default: false
# Workaround for https://github.com/actions/checkout/issues/1169
LFS_REPO_PATH:
required: false
type: string
default: ""

env: "${{secrets}}"

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/django-step-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ on:
type: boolean
default: false

# Workaround for https://github.com/actions/checkout/issues/1169
LFS_REPO_PATH:
required: false
type: string
default: ""

env: "${{secrets}}"

jobs:
Expand Down Expand Up @@ -60,7 +66,7 @@ jobs:
lfs: 'true'
- uses: actions/checkout@v3
if: ${{ inputs.ENABLE_LFS == false }}
- run: git config --global --add safe.directory /__w/mobygis-waterjade/mobygis-waterjade
- run: git config --global --add safe.directory ${{ inputs.LFS_REPO_PATH }}
if: ${{ inputs.ENABLE_LFS == true }}
- name: Checkout LFS objects
if: ${{ inputs.ENABLE_LFS == true }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/django-workflow-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ on:
required: false
type: boolean
default: false
# Workaround for https://github.com/actions/checkout/issues/1169
LFS_REPO_PATH:
required: false
type: string
default: ""
jobs:
django-lint-check:
uses:
Expand All @@ -49,6 +54,7 @@ jobs:
DJANGO_MIGRATIONS_CHECK_APPS: ${{inputs.DJANGO_MIGRATIONS_CHECK_APPS}}
SETUP_COMMANDS: ${{inputs.SETUP_COMMANDS}}
ENABLE_LFS: ${{inputs.ENABLE_LFS}}
LFS_REPO_PATH: ${{inputs.LFS_REPO_PATH}}
secrets: inherit

django-tests:
Expand All @@ -62,4 +68,5 @@ jobs:
RUN: ${{inputs.RUN}}
SETUP_COMMANDS: ${{ inputs.SETUP_COMMANDS }}
ENABLE_LFS: ${{inputs.ENABLE_LFS}}
LFS_REPO_PATH: ${{inputs.LFS_REPO_PATH}}
secrets: inherit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ In addition, it is possible to specify this optional input:
- **DJANGO_MIGRATIONS_CHECK_APPS**: The Django apps on which to run migration checks.
- **SETUP_COMMANDS**: Allow to execute commands before the download of the dependencies. Useful to install packages required for Python dependencies.
- **ENABLE_LFS**: To enable Git LFS support on checkout
- **LFS_REPO_PATH**: Required when ENABLE_LFS is true. Workaround for https://github.com/actions/checkout/issues/1169. Set to "/__w/repo-name/repo-name"

This is an example to show how data should be formatted.

Expand Down

0 comments on commit 2a0fa65

Please sign in to comment.