Skip to content

Commit

Permalink
Remove deprecated set-output command
Browse files Browse the repository at this point in the history
  • Loading branch information
yeisonvargasf committed May 29, 2023
1 parent d8bd6f7 commit 9783a32
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Safety Action Build And Publish

on:
push:
branches: [main]
tags:
- "^(\\d+\\.\\d+(\\.\\d+)?)$"
branches: [image-builds]

env:
DOCKER_BUILDKIT: 1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/gh-action-integration-matrix.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[
{"version": "2.3.4"}
{"version": "2.3.4"},
{"version": "2.3.5"},
{"version": ""}
]
4 changes: 2 additions & 2 deletions .github/workflows/test-insecure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Safety Action Insecure Tests

on:
push:
branches: [main, develop]
branches: [main, develop, image-ci]

jobs:
matrix:
Expand All @@ -16,7 +16,7 @@ jobs:
- id: set-matrix
run: |
TASKS=$(echo $(cat .github/workflows/gh-action-integration-matrix.json) | sed 's/ //g' )
echo "::set-output name=matrix::$TASKS"
echo "matrix=$TASKS" >> $GITHUB_OUTPUT
##### Auto mode tests
### File scanning
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-secure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Safety Action Secure Tests

on:
push:
branches: [main, develop]
branches: [main, develop, image-ci]

jobs:
matrix:
Expand All @@ -17,7 +17,7 @@ jobs:
- id: set-matrix
run: |
TASKS=$(echo $(cat .github/workflows/gh-action-integration-matrix.json) | sed 's/ //g' )
echo "::set-output name=matrix::$TASKS"
echo "matrix=$TASKS" >> $GITHUB_OUTPUT
##### Auto mode tests
### File scanning
Expand Down
11 changes: 5 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,11 @@ exec 5>&1
output=$(python -m safety check -r "${SAFETY_ACTION_REQUIREMENTS}" --output="${SAFETY_ACTION_OUTPUT_FORMAT}" ${SAFETY_ACTION_CONTINUE_ON_ERROR} ${SAFETY_ACTION_ARGS} | tee >(cat - >&5))
exit_code=$?

# https://github.community/t/set-output-truncates-multiline-strings/16852/3
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
echo "exit-code=$exit_code" >> $GITHUB_OUTPUT

echo "::set-output name=exit-code::$exit_code"
echo "::set-output name=cli-output::$output"
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "cli-output<<$EOF" >> $GITHUB_OUTPUT
echo "$output" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

exit $exit_code

0 comments on commit 9783a32

Please sign in to comment.