Add changed_charts and chart_version outputs (#130)

* Add `changed_charts` and `chart_version` outputs

This should let downstream steps make conditional decisions
based on what we found.

Also: fix a confusing double-negative test in main().

Signed-off-by: Nathan J. Mehl <n@oden.io>

---------

Signed-off-by: Nathan J. Mehl <n@oden.io>
This commit is contained in:
Nathan J Mehl
2023-07-11 14:12:27 +02:00
committed by GitHub
parent 4b85f2c82c
commit 2504907988
3 changed files with 244 additions and 216 deletions
+17 -1
View File
@@ -32,11 +32,19 @@ inputs:
description: Mark the created GitHub release as 'latest'
required: false
default: true
outputs:
changed_charts:
description: "A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if `--skip_packaging` is used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them."
value: ${{ steps.release.outputs.changed_charts }}
chart_version:
description: "The version of the most recently generated charts; will be set even if no charts have been updated since the last run."
value: ${{ steps.release.outputs.chart_version }}
runs:
using: composite
steps:
- run: |
- id: release
run: |
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
@@ -77,4 +85,12 @@ runs:
fi
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
if [[ -f changed_charts.txt ]]; then
cat changed_charts.txt >> "$GITHUB_OUTPUT"
fi
if [[ -f chart_version.txt ]]; then
cat chart_version.txt >> "$GITHUB_OUTPUT"
fi
rm -f changed_charts.txt chart_version.txt
shell: bash