Skip to content

Commit

Permalink
update name and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eamon0989 committed May 9, 2023
1 parent 3f7be2b commit 83fc99a
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 79 deletions.
34 changes: 30 additions & 4 deletions README.md
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
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'git-filter-repo-action'
name: 'git-repo-size-reducer'
description: 'Filters unneeded objects from a git repository using git-filter-repo'
runs:
using: 'docker'
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ version: '3.8'

services:
app:
image: git-filter-repo-action
image: git-repo-size-reducer-action
build: .

147 changes: 75 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
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]>",
Expand Down

0 comments on commit 83fc99a

Please sign in to comment.