Skip to content

Commit

Permalink
feat: add skip_push
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 21, 2023
1 parent 5165a92 commit f0d15ef
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: 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: "! 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 f0d15ef

Please sign in to comment.