Skip to content

Commit cbf2fdd

Browse files
committed
ci: attempt to fix set-output again
1 parent a850eef commit cbf2fdd

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/workflows/watch-dependencies.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ jobs:
7979
- name: PR summary
8080
id: prsummary
8181
if: steps.local.outputs.tag != steps.latest.outputs.tag
82-
# Needs to be a single line string
83-
# https://trstringer.com/github-actions-multiline-strings/#option-1---string-substitution
8482
run: |
8583
pip install PyGithub
86-
PR_LIST=$(./scripts/get-prs.py ${{matrix.repository}} ${{steps.local.outputs.tag}} ${{steps.latest.outputs.tag}} --github-action-escape)
87-
echo "prs=$PR_LIST" >> $GITHUB_OUTPUT
84+
85+
# We want to set multiline output, so we rely on this technique:
86+
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
87+
#
88+
eof_randomized=EOF_$RANDOM
89+
echo "prs<<$eof_randomized" >> $GITHUB_OUTPUT
90+
./scripts/get-prs.py ${{matrix.github_repo}} ${{steps.local.outputs.version}} ${{steps.latest.outputs.version}} >> $GITHUB_OUTPUT
91+
echo "$eof_randomized" >> $GITHUB_OUTPUT
8892
env:
8993
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9094

@@ -207,12 +211,16 @@ jobs:
207211
- name: PR summary
208212
id: prsummary
209213
if: matrix.github_repo && (steps.local.outputs.version != steps.latest.outputs.version)
210-
# Needs to be a single line string
211-
# https://trstringer.com/github-actions-multiline-strings/#option-1---string-substitution
212214
run: |
213215
pip install PyGithub
214-
PR_LIST=$(./scripts/get-prs.py ${{matrix.github_repo}} ${{steps.local.outputs.version}} ${{steps.latest.outputs.version}} --github-action-escape)
215-
echo "prs=$PR_LIST" >> $GITHUB_OUTPUT
216+
217+
# We want to set multiline output, so we rely on this technique:
218+
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
219+
#
220+
eof_randomized=EOF_$RANDOM
221+
echo "prs<<$eof_randomized" >> $GITHUB_OUTPUT
222+
./scripts/get-prs.py ${{matrix.github_repo}} ${{steps.local.outputs.version}} ${{steps.latest.outputs.version}} >> $GITHUB_OUTPUT
223+
echo "$eof_randomized" >> $GITHUB_OUTPUT
216224
env:
217225
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218226

scripts/get-prs.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ def extract_gitref(s):
2929
parser.add_argument("repo", help="The repository in format user/repo")
3030
parser.add_argument("start", help="commit or image/chart version from which to start")
3131
parser.add_argument("end", help="commit or image/chart version to which to end")
32-
parser.add_argument(
33-
"--github-action-escape",
34-
action="store_true",
35-
help="Escape output for GitHub Action",
36-
)
3732
parser.add_argument(
3833
"--max-commits",
3934
type=int,
@@ -65,7 +60,4 @@ def extract_gitref(s):
6560
]
6661

6762
md = ["# PRs"] + pr_summaries + ["", f"{r.html_url}/compare/{start}...{end}"]
68-
if args.github_action_escape:
69-
print("%0A".join(md))
70-
else:
71-
print("\n".join(md))
63+
print("\n".join(md))

0 commit comments

Comments
 (0)