-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
108 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
# git-filter-repo action | ||
# git-repo-size-reducer action | ||
|
||
This action filters unneeded objects from a git repository using git-filter-repo. | ||
This action filters unneeded objects from a git repository using git-filter-repo. It can be used in the case that a git repository is too large for deployment, for example, to Heroku. | ||
|
||
## Inputs | ||
It works by using [git-filter-repo](https://github.com/newren/git-filter-repo), an excellent tool which is recommended by the git docs instead of git filter [here](https://git-scm.com/docs/git-filter-branch#_warning). | ||
|
||
## Outputs | ||
It first runs `git filter-repo --analyze`, which creates the file `.git/filter-repo/analysis/path-deleted-sizes.txt`. Then it runs a script which extracts all of the filepaths of artifacts from deleted files, and adds them to `files-to-delete.txt`. Then finally it runs `git filter-repo --invert-paths --paths-from-file files-to-delete.txt --force` which rewrites your git history, removing all of the files from it and recovering the storage. | ||
|
||
Finally, it prints a report that you can read when the action has finished running, like this: | ||
|
||
```sh | ||
New history written in 0.04 seconds; now repacking/cleaning... | ||
Repacking your repo and cleaning out old unneeded objects | ||
Completely finished after 0.12 seconds. | ||
Your repo previously contained 4 megabytes or 4605 kilobytes of objects. | ||
It now contains 0 megabytes or 35 kilobytes of objects. | ||
You have filtered 4 megabytes or 4570 kilobytes of objects from your git repository. | ||
``` | ||
|
||
## Example usage | ||
|
||
```yml | ||
heroku: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Docker-test-action | ||
id: hello | ||
uses: eamon0989/git-repo-size-reducer@v1 | ||
|
||
# add your logic to deploy the branch here | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ version: '3.8' | |
|
||
services: | ||
app: | ||
image: git-filter-repo-action | ||
image: git-repo-size-reducer-action | ||
build: . | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "git-filter-repo-action", | ||
"name": "git-repo-size-reducer-action", | ||
"description": "Filters unneeded objects from a git repository using git-filter-repo", | ||
"version": "1.0.0", | ||
"author": "Eamon O'Callaghan <[email protected]>", | ||
|