Skip to content

Commit

Permalink
fix: return code from yamlfixer new version
Browse files Browse the repository at this point in the history
Refs: #10 #12
  • Loading branch information
mbarre committed Mar 24, 2022
1 parent 47cdbf8 commit 79609ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Container image that runs your code
FROM optnc/yamlfixer:0.3.9
FROM optnc/yamlfixer:0.4.7

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand All @@ -9,6 +9,7 @@ RUN chmod +x /entrypoint.sh
RUN apk update
RUN apk add git
RUN apk add curl
RUN apk add jq

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh -l

yamlfixer $OPTIONS /github/workspace/$YAML_FILE
CHANGES=$(yamlfixer --nochange --jsonsummary /github/workspace/$YAML_FILE 2>&1 | jq '[.fixed,.modified] | add')

result=$?
if [ $result -ne 0 ] ; then
if [ $CHANGES -gt 0 ] ; then
yamlfixer $OPTIONS /github/workspace/$YAML_FILE
echo "WARN: all input files didn't pass successfully yamllint strict mode." ;
echo "INFO : create a new branch with corrections." ;
cd /github/workspace
Expand Down

0 comments on commit 79609ff

Please sign in to comment.