Skip to content

Commit 79609ff

Browse files
committed
fix: return code from yamlfixer new version
Refs: #10 #12
1 parent 47cdbf8 commit 79609ff

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Container image that runs your code
2-
FROM optnc/yamlfixer:0.3.9
2+
FROM optnc/yamlfixer:0.4.7
33

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

1314
# Code file to execute when the docker container starts up (`entrypoint.sh`)
1415
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh -l
22

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

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

0 commit comments

Comments
 (0)