Skip to content

Commit e19cc58

Browse files
authored
Fix multiline GitHub output and add dep report steps (DataDog#22929)
1 parent 4952dbf commit e19cc58

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/update-dependencies.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,27 @@ jobs:
3838
- name: Update dependencies
3939
run: |-
4040
ddev dep updates --sync --report /tmp/dep-report.md --report-type markdown
41+
- name: Check dependency report
42+
id: dep-report-check
43+
run: |-
44+
if [ -f /tmp/dep-report.md ]; then
45+
echo "exists=true" >> "$GITHUB_OUTPUT"
46+
else
47+
echo "exists=false" >> "$GITHUB_OUTPUT"
48+
fi
49+
- name: Print dependency report
50+
if: steps.dep-report-check.outputs.exists == 'true'
51+
run: cat /tmp/dep-report.md
4152
- name: Read dependency report
4253
id: dep-summary
54+
if: steps.dep-report-check.outputs.exists == 'true'
4355
run: |-
44-
echo "summary<<EOF" >> "$GITHUB_OUTPUT"
45-
cat /tmp/dep-report.md >> "$GITHUB_OUTPUT"
46-
echo "EOF" >> "$GITHUB_OUTPUT"
56+
delimiter="$(openssl rand -hex 16)"
57+
{
58+
echo "summary<<${delimiter}"
59+
cat /tmp/dep-report.md
60+
echo "${delimiter}"
61+
} >> "$GITHUB_OUTPUT"
4762
- name: Update licenses
4863
run: |-
4964
ddev validate licenses --sync
@@ -68,7 +83,7 @@ jobs:
6883
### What does this PR do?
6984
Update the dependencies
7085
71-
${{ steps.dep-summary.outputs.summary }}
86+
${{ steps.dep-report-check.outputs.exists == 'true' && steps.dep-summary.outputs.summary || '' }}
7287
7388
This PR was automatically generated by the following workflow:
7489
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)