Skip to content

Commit e351ace

Browse files
authored
Merge pull request #2984 from consideRatio/pr/fix-vuln-scan-regression
ci: fix vuln-scan regression following set-output deprecation
2 parents 261e42b + b45108d commit e351ace

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/vuln-scan.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ jobs:
142142
cat tmp/scan_$1.json | jq -r '.Results[] | select(.Vulnerabilities != null) | .Type + " | " + (.Vulnerabilities[] | .VulnerabilityID + " | " + .PkgName + " | " + .InstalledVersion + " | " + .FixedVersion)' | sort >> tmp/md_summary_$1.md
143143
fi
144144
145-
# Use hack to set a multiline string output
146-
# ref: https://github.com/actions/toolkit/issues/403#issue-593398879
147-
TMP=$(cat tmp/md_summary_$1.md)
148-
TMP="${TMP//'%'/'%25'}"
149-
TMP="${TMP//$'\n'/'%0A'}"
150-
TMP="${TMP//$'\r'/'%0D'}"
151-
echo "md_summary_$1=$TMP" >> $GITHUB_OUTPUT
145+
# Set a multiline string output with the following technique:
146+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
147+
#
148+
eof_marker=EOF_$RANDOM
149+
echo "md_summary_$1<<$eof_marker" >> $GITHUB_OUTPUT
150+
cat tmp/md_summary_$1.md >> $GITHUB_OUTPUT
151+
echo "$eof_marker" >> $GITHUB_OUTPUT
152152
153153
# Calculate a hash of the markdown summary
154154
HASH=$(cat tmp/md_summary_$1.md | sha1sum)

0 commit comments

Comments
 (0)