From 83fc99a6d9dbae6b947d6445c05b8dedf5fb6201 Mon Sep 17 00:00:00 2001 From: Eamon Date: Tue, 9 May 2023 12:00:42 +0200 Subject: [PATCH] update name and documentation --- README.md | 34 +++++++++-- action.yml | 2 +- docker-compose.yml | 2 +- package-lock.json | 147 +++++++++++++++++++++++---------------------- package.json | 2 +- 5 files changed, 108 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 4e93de5..4892e7e 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/action.yml b/action.yml index ed6d039..9b3f6e7 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/docker-compose.yml b/docker-compose.yml index 4985599..b510633 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,6 @@ version: '3.8' services: app: - image: git-filter-repo-action + image: git-repo-size-reducer-action build: . \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 17cede7..4a4eba8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,74 +1,77 @@ { - "name": "docker-test-action-github", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "dependencies": { - "@actions/core": "^1.10.0" - } - }, - "node_modules/@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "node_modules/@actions/http-client": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", - "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", - "dependencies": { - "tunnel": "^0.0.6" - } - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - } - }, - "dependencies": { - "@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "@actions/http-client": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", - "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", - "requires": { - "tunnel": "^0.0.6" - } - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } + "name": "git-repo-size-reducer-action", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "git-repo-size-reducer-action", + "version": "1.0.0", + "dependencies": { + "@actions/core": "^1.10.0" + } + }, + "node_modules/@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/http-client": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", + "dependencies": { + "tunnel": "^0.0.6" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + } + }, + "dependencies": { + "@actions/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "requires": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "@actions/http-client": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", + "requires": { + "tunnel": "^0.0.6" + } + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } } diff --git a/package.json b/package.json index d13de3c..09e959c 100644 --- a/package.json +++ b/package.json @@ -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 ",