Skip to content

Commit 4a4ba6b

Browse files
CopilotJamesIves
andcommitted
Rename parameter from git-lfs to lfs and add integration test
Co-authored-by: JamesIves <10888441+JamesIves@users.noreply.github.com>
1 parent 94349b3 commit 4a4ba6b

File tree

6 files changed

+38
-7
lines changed

6 files changed

+38
-7
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
integration/large-file.bin filter=lfs diff=lfs merge=lfs -text

.github/workflows/integration.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,30 @@ jobs:
359359
with:
360360
github_token: ${{ secrets.GITHUB_TOKEN }}
361361
branches: gh-pages
362+
363+
# Deploys using Git LFS support for large files.
364+
integration-lfs:
365+
needs: integration-root-folder
366+
runs-on: ubuntu-latest
367+
steps:
368+
- name: Checkout
369+
uses: actions/checkout@v5.0.0
370+
with:
371+
persist-credentials: false
372+
lfs: true
373+
374+
- name: Build and Deploy
375+
uses: JamesIves/github-pages-deploy-action@v4
376+
with:
377+
folder: integration
378+
target-folder: cat/lfs-test
379+
lfs: true
380+
silent: false
381+
git-config-name: Montezuma
382+
git-config-email: montezuma@jamesiv.es
383+
384+
- name: Cleanup Generated Branch
385+
uses: dawidd6/action-delete-branch@v3.1.0
386+
with:
387+
github_token: ${{ secrets.GITHUB_TOKEN }}
388+
branches: gh-pages

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ By default, the action does not need any token configuration and uses the provid
113113
| `single-commit` | This option can be toggled to `true` if you'd prefer to have a single commit on the deployment branch instead of maintaining the full history. **Using this option will also cause any existing history to be wiped from the deployment branch**. | `with` | **No** |
114114
| `force` | Force-push new deployments to overwrite the previous version; otherwise, attempt to rebase new deployments onto any existing ones. This option is turned on by default and can be toggled off by setting it to `false`, which may be useful if there are multiple deployments in a single branch. | `with` | **No** |
115115
| `attempt-limit` | How many rebase attempts to make before suspending the job. This option defaults to `3` and may be useful to increase when there are multiple deployments in a single branch. | `with` | **No** |
116-
| `git-lfs` | Enable Git Large File Storage (LFS) support for handling large files. This should be set to `true` if your deployment folder contains files tracked by Git LFS. Defaults to `false`. | `with` | **No** |
116+
| `lfs` | Enable Git Large File Storage (LFS) support for handling large files. This should be set to `true` if your deployment folder contains files tracked by Git LFS. Defaults to `false`. | `with` | **No** |
117117
| `silent` | Silences the action output preventing it from displaying git messages. | `with` | **No** |
118118
| `tag` | Add a tag to the commit. Only works when `dry-run` is not used. | `with` | **No** |
119119

@@ -135,17 +135,17 @@ This value is also set as a step output as `deployment-status`.
135135

136136
### Using Git Large File Storage (LFS) 📦
137137

138-
If your project contains files larger than 100MB, you'll need to use [Git Large File Storage (LFS)](https://git-lfs.github.com/) to avoid GitHub's file size limits. This action supports LFS files when the `git-lfs` input is set to `true`.
138+
If your project contains files larger than 100MB, you'll need to use [Git Large File Storage (LFS)](https://git-lfs.github.com/) to avoid GitHub's file size limits. This action supports LFS files when the `lfs` input is set to `true`.
139139

140140
```yml
141141
- name: Deploy to GitHub Pages
142142
uses: JamesIves/github-pages-deploy-action@v4
143143
with:
144144
folder: build
145-
git-lfs: true
145+
lfs: true
146146
```
147147

148-
When `git-lfs` is enabled, the action will:
148+
When `lfs` is enabled, the action will:
149149
1. Install and configure Git LFS in the deployment environment
150150
2. Properly handle LFS pointer files during the deployment process
151151
3. Ensure large files are correctly pushed to GitHub Pages

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ inputs:
9595
required: false
9696
default: 3
9797

98-
git-lfs:
98+
lfs:
9999
description: 'Enable Git Large File Storage (LFS) support for handling large files. This should be set to true if your deployment folder contains files tracked by Git LFS.'
100100
required: false
101101
default: false

integration/large-file.bin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:30e14955ebf1352266dc2ff8067e68104607e750abb9d3b36582b8af909fcb58
3+
size 1048576

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export const action: ActionInterface = {
9999
force: !isNullOrUndefined(getInput('force'))
100100
? getInput('force').toLowerCase() === 'true'
101101
: true,
102-
gitLfs: !isNullOrUndefined(getInput('git-lfs'))
103-
? getInput('git-lfs').toLowerCase() === 'true'
102+
gitLfs: !isNullOrUndefined(getInput('lfs'))
103+
? getInput('lfs').toLowerCase() === 'true'
104104
: false,
105105
attemptLimit: !isNullOrUndefined(getInput('attempt-limit'))
106106
? parseInt(getInput('attempt-limit'), 10)

0 commit comments

Comments
 (0)