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

Add single-commit input #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,20 @@ the `with` parameter.
Default: `${{ github.token }}`, which gives the action permission to
deploy to the current repository.

- **(Advanced)** `single-commit`: Keep a single commit on the preview branch instead of maintaining the full history.

**Caution**: Enabling this will erase any existing history on the preview branch.
Only enable this if you don't use GitHub Pages for anything besides PR previews in the target repository.

If your preview deployments contain several large binary files, your preview branch may grow significantly in size over time.
Enabling this will force-push to the branch with a single commit, erasing the history for that branch and reducing the size of your preview branch.

Equivalent to
[JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action)'s
'single-commit' setting.

Default: `false`

- **(Advanced)** `action`: Determines what this action will do when it is
executed. Supported values: `deploy`, `remove`, `none`, `auto`.

Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ inputs:
description: Custom pages URL
required: false
default: ""
single-commit:
description: >
Keep a single commit on the preview branch instead of maintaining the full history.
Enabling this will erase any existing history on the preview branch.
required: false
default: false
action:
description: >
Determines what this action will do when it is executed. Supported
Expand Down Expand Up @@ -130,6 +136,7 @@ runs:
folder: ${{ inputs.source-dir }}
target-folder: ${{ env.targetdir }}
commit-message: Deploy preview for PR ${{ env.pr }} 🛫
single-commit: ${{ inputs.single-commit }}
force: false

- name: Expose deployment URL
Expand Down Expand Up @@ -168,6 +175,7 @@ runs:
folder: ${{ env.emptydir }}
target-folder: ${{ env.targetdir }}
commit-message: Remove preview for PR ${{ env.pr }} 🛬
single-commit: ${{ inputs.single-commit }}
force: false

- name: Leave a comment after removal
Expand Down