fix multiline GITHUB_OUTPUT

This commit is contained in:
sebthom
2023-05-04 13:14:46 +02:00
parent b82b1f71dd
commit 44630c0506

View File

@@ -71,16 +71,13 @@ jobs:
updates=$(pdm update 2>&1 |tee /dev/fd/5) updates=$(pdm update 2>&1 |tee /dev/fd/5)
if git diff --exit-code pdm.lock; then if git diff --exit-code pdm.lock; then
echo "updates=" >> $GITHUB_OUTPUT echo "updates=" >> "$GITHUB_OUTPUT"
else else
updates=$(echo "$updates" | grep Update) # https://github.com/orgs/community/discussions/26288#discussioncomment-3876281
delimiter="$(openssl rand -hex 8)"
# see https://trstringer.com/github-actions-multiline-strings/ echo "updates<<${delimiter}" >> "${GITHUB_OUTPUT}"
updates="${updates//'%'/'%25'}" echo "$(echo "$updates" | grep Update | grep -v kleinanzeigen-bot)" >> "${GITHUB_OUTPUT}"
updates="${updates//$'\n'/'%0A'}" echo "${delimiter}" >> "${GITHUB_OUTPUT}"
updates="${updates//$'\r'/'%0D'}"
echo "updates=${updates}" >> $GITHUB_OUTPUT
fi fi
- name: Create PR - name: Create PR