Skip to content

Commit 0be5fbf

Browse files
ivanasabiCopilotenriqueavindi
authored
fix: pass release tag_name via env instead of interpolating it into run (#81)
* fix: pass release tag_name via env instead of interpolating it into run Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: quote redirections in release version step to satisfy shellcheck The quality gate introduced by the Go profile adoption (#65) fails on the pre-existing release.yml: SC2086 (unquoted $GITHUB_OUTPUT redirects) and SC2129 (individual redirects instead of a grouped one). Group the GITHUB_OUTPUT writes and quote the variable; the debug echo stays outside the group so it keeps printing to the job log. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ivanasabi <ivanasabi@ext.inditex.com> --------- Signed-off-by: ivanasabi <ivanasabi@ext.inditex.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: enriqueavi <146724635+enriqueavindi@users.noreply.github.com>
1 parent 1e7815f commit 0be5fbf

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,45 @@ jobs:
3232
- name: 📝 Load Operator version
3333
id: version
3434
run: |
35-
echo "version=$(make print-VERSION | cut -d'=' -f2)" >> $GITHUB_OUTPUT
36-
echo "values_version=$(yq '.deployment.image.tag' chart/values.yaml)" >> $GITHUB_OUTPUT
37-
echo "chart_version=$(yq '.appVersion' chart/Chart.yaml)" >> $GITHUB_OUTPUT
38-
echo "catalog_version=$(yq '.spec.image' deploy/catalog_source.yaml | cut -d':' -f2)" >> $GITHUB_OUTPUT
39-
echo $GITHUB_OUTPUT
35+
{
36+
echo "version=$(make print-VERSION | cut -d'=' -f2)"
37+
echo "values_version=$(yq '.deployment.image.tag' chart/values.yaml)"
38+
echo "chart_version=$(yq '.appVersion' chart/Chart.yaml)"
39+
echo "catalog_version=$(yq '.spec.image' deploy/catalog_source.yaml | cut -d':' -f2)"
40+
} >> "$GITHUB_OUTPUT"
41+
echo "$GITHUB_OUTPUT"
4042
4143
check:
4244
name: 🔎 Check versions
4345
needs: release
4446
runs-on: ubuntu-latest
4547
steps:
4648
- name: 🔎 Check versions
49+
env:
50+
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
4751
run: |
4852
echo "version: ${{ needs.release.outputs.version }}"
4953
echo "values_version: ${{ needs.release.outputs.values_version }}"
5054
echo "chart_version: ${{ needs.release.outputs.chart_version }}"
51-
echo "tag_name: ${{ github.event.release.tag_name }}"
55+
echo "tag_name: $RELEASE_TAG_NAME"
5256
echo "catalog_version: ${{ needs.release.outputs.catalog_version }}"
5357
54-
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.version }}" ]; then
58+
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.version }}" ]; then
5559
echo "Version in Makefile does not match release tag"
5660
exit 1
5761
fi
5862
59-
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.values_version }}" ]; then
63+
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.values_version }}" ]; then
6064
echo "Version in chart/values.yaml does not match release tag"
6165
exit 1
6266
fi
6367
64-
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.chart_version }}" ]; then
68+
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.chart_version }}" ]; then
6569
echo "Version in chart/Chart.yaml does not match release tag"
6670
exit 1
6771
fi
6872
69-
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.catalog_version }}" ]; then
73+
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.catalog_version }}" ]; then
7074
echo "Version in deploy/catalog_source.yaml does not match release tag"
7175
exit 1
7276
fi

0 commit comments

Comments
 (0)