Skip to content

Commit

Permalink
Merge pull request #20 from aquaproj/feat/add-skip_push
Browse files Browse the repository at this point in the history
feat: add skip_push
  • Loading branch information
suzuki-shunsuke authored Jan 22, 2023
2 parents 5165a92 + beec9af commit 2413c53
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $ aqua g -i int128/ghcp

- `working_directory`
- `prune`
- `skip_push`

## Required Environment Variables

Expand Down
16 changes: 16 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ inputs:
prune:
required: false
default: false
skip_push:
required: false
default: false
runs:
using: composite
steps:
Expand Down Expand Up @@ -34,8 +37,21 @@ runs:
- shell: bash
working-directory: ${{inputs.working_directory}}
run: git add ${{steps.find.outputs.checksum_file}}

- shell: bash
working-directory: ${{inputs.working_directory}}
if: fromJSON(inputs.skip_push)
run: |
if ! git diff --cached --exit-code ${CHECKSUM_FILE}; then
echo "::error file=${CHECKSUM_FILE}::${CHECKSUM_FILE} isn't latest."
exit 1
fi
env:
CHECKSUM_FILE: ${{steps.find.outputs.checksum_file}}

- shell: bash
working-directory: ${{inputs.working_directory}}
if: "! fromJSON(inputs.skip_push)"
run: |
if ! git diff --cached --exit-code ${CHECKSUM_FILE}; then
echo "::error file=${CHECKSUM_FILE}::${CHECKSUM_FILE} isn't latest. A commit is pushed automatically to update ${CHECKSUM_FILE}."
Expand Down

0 comments on commit 2413c53

Please sign in to comment.