Skip to content

Commit

Permalink
✨ Preserve README Option
Browse files Browse the repository at this point in the history
  • Loading branch information
JumperBot committed Jul 18, 2022
1 parent d711c22 commit ff6bb1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
16 changes: 12 additions & 4 deletions Obliterator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ git config --global user.email "github-actions[bot]@users.noreply.github.com"

mv .git/ ../
cd ..
rm -rf workspace/.*
rm -rf workspace/*
mv .git/ workspace/
cd workspace

git add -A
git commit -a -m "$2"
git push --set-upstream origin "$1"
if [ $3 = true ]; then
git restore README.*
fi

echo "We're done over here!"
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "$2"
git push --set-upstream origin "$1"
echo "We're done over here!"
else
echo "Nothing to commit here!"
fi
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Add this to your `Actions`:
with:
branch: "dev-branch" # defaults to master
message: ":boom: End Game Commit" # defaults to :boom: Obliterated!
preserve-readme: true # defaults to: false
```
# License
#License
This is licensed under the [MIT LICENSE](./LICENSE)
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ inputs:
description: "The commit message to pass with: git commit -a -m"
required: false
default: ":boom: Obliterated!"
preserve-readme:
decription: "At least 1 root/README.* will be preserved"
requied: false
default: false
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.branch }}
- ${{ inputs.message }}
- ${{ inputs.preserve-readme }}

0 comments on commit ff6bb1c

Please sign in to comment.