From 7f5af711238afa609b5aef495386a65021153b54 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Tue, 8 Oct 2024 16:53:06 +0100 Subject: [PATCH 1/8] fix: modify conditions for release PR comments --- .github/actions/bulk-release-chart/action.yaml | 4 ++-- .github/actions/bulk-release-container/action.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/bulk-release-chart/action.yaml b/.github/actions/bulk-release-chart/action.yaml index e183cb4d..e51d5c7e 100644 --- a/.github/actions/bulk-release-chart/action.yaml +++ b/.github/actions/bulk-release-chart/action.yaml @@ -262,7 +262,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: inputs.comment-enabled == 'true' + if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -271,7 +271,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' + if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} diff --git a/.github/actions/bulk-release-container/action.yaml b/.github/actions/bulk-release-container/action.yaml index 9fdbd9f0..45823bbc 100644 --- a/.github/actions/bulk-release-container/action.yaml +++ b/.github/actions/bulk-release-container/action.yaml @@ -379,7 +379,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: inputs.comment-enabled == 'true' + if: (inputs.comment-enabled == 'true') && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -388,7 +388,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' + if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} From dd4bb81660206cd0c20da7775f2437c89a0aae86 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Tue, 8 Oct 2024 17:11:22 +0100 Subject: [PATCH 2/8] fix: wrap in brackets --- .github/actions/bulk-release-chart/action.yaml | 4 ++-- .github/actions/bulk-release-container/action.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/bulk-release-chart/action.yaml b/.github/actions/bulk-release-chart/action.yaml index e51d5c7e..2fe4a622 100644 --- a/.github/actions/bulk-release-chart/action.yaml +++ b/.github/actions/bulk-release-chart/action.yaml @@ -262,7 +262,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published + if: ${{(inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -271,7 +271,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published + if: ${{(inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} diff --git a/.github/actions/bulk-release-container/action.yaml b/.github/actions/bulk-release-container/action.yaml index 45823bbc..d9f4f537 100644 --- a/.github/actions/bulk-release-container/action.yaml +++ b/.github/actions/bulk-release-container/action.yaml @@ -379,7 +379,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: (inputs.comment-enabled == 'true') && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published + if: ${{(inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -388,7 +388,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published + if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} From 642e849f49ae7d33518f113ed781ad3338c3acae Mon Sep 17 00:00:00 2001 From: rdash99 Date: Wed, 9 Oct 2024 09:39:45 +0100 Subject: [PATCH 3/8] fix: missing brackets --- .github/actions/bulk-release-chart/action.yaml | 4 ++-- .github/actions/bulk-release-container/action.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/bulk-release-chart/action.yaml b/.github/actions/bulk-release-chart/action.yaml index 2fe4a622..c70cec33 100644 --- a/.github/actions/bulk-release-chart/action.yaml +++ b/.github/actions/bulk-release-chart/action.yaml @@ -262,7 +262,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: ${{(inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} + if: ${{ inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -271,7 +271,7 @@ runs: - name: comment on release success id: release-pr-comment - if: ${{(inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} + if: ${{ (inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} diff --git a/.github/actions/bulk-release-container/action.yaml b/.github/actions/bulk-release-container/action.yaml index d9f4f537..335972e6 100644 --- a/.github/actions/bulk-release-container/action.yaml +++ b/.github/actions/bulk-release-container/action.yaml @@ -379,7 +379,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: ${{(inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} + if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -388,7 +388,7 @@ runs: - name: comment on release success id: release-pr-comment - if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)}} + if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} From 01840661b45dff2fa634d7a1399d559ec3dd38f7 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Wed, 9 Oct 2024 10:15:12 +0100 Subject: [PATCH 4/8] fix: missing brackets --- .github/actions/bulk-release-chart/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/bulk-release-chart/action.yaml b/.github/actions/bulk-release-chart/action.yaml index c70cec33..dd025919 100644 --- a/.github/actions/bulk-release-chart/action.yaml +++ b/.github/actions/bulk-release-chart/action.yaml @@ -262,7 +262,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: ${{ inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -271,7 +271,7 @@ runs: - name: comment on release success id: release-pr-comment - if: ${{ (inputs.comment-enabled == 'true' && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} From 27813018150cc809c2b883305f0f12160031b461 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Wed, 9 Oct 2024 10:23:59 +0100 Subject: [PATCH 5/8] test: stop releases outright --- .github/workflows/bulk-pr-and-release-chart.yaml | 2 +- .github/workflows/bulk-pr-and-release-container.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bulk-pr-and-release-chart.yaml b/.github/workflows/bulk-pr-and-release-chart.yaml index fd92920b..2b113154 100644 --- a/.github/workflows/bulk-pr-and-release-chart.yaml +++ b/.github/workflows/bulk-pr-and-release-chart.yaml @@ -114,7 +114,7 @@ jobs: registry-token: ${{ secrets.registry-token }} - name: release - if: github.event_name == 'push' + if: github.event_name == 'push' && inputs.release-info != '' uses: ./.tmp/.github/actions/bulk-release-chart with: job-name: ${{ inputs.job-name }} diff --git a/.github/workflows/bulk-pr-and-release-container.yaml b/.github/workflows/bulk-pr-and-release-container.yaml index ff683d3d..36a63f11 100644 --- a/.github/workflows/bulk-pr-and-release-container.yaml +++ b/.github/workflows/bulk-pr-and-release-container.yaml @@ -125,7 +125,7 @@ jobs: cosign-password: ${{ secrets.cosign-password }} - name: release - if: github.event_name == 'push' + if: github.event_name == 'push' && inputs.release-info != '' uses: ./.tmp/.github/actions/bulk-release-container with: job-name: ${{ inputs.job-name }} From 512169c43539a0dc36f5219237dfbda4ebe09da0 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Fri, 31 Jan 2025 13:18:29 +0000 Subject: [PATCH 6/8] test: try updating the condition for bulk releases by removing brackets --- .github/actions/bulk-release-chart/action.yaml | 4 ++-- .github/actions/bulk-release-container/action.yaml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/actions/bulk-release-chart/action.yaml b/.github/actions/bulk-release-chart/action.yaml index 57e68db1..b0215fa6 100644 --- a/.github/actions/bulk-release-chart/action.yaml +++ b/.github/actions/bulk-release-chart/action.yaml @@ -262,7 +262,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -271,7 +271,7 @@ runs: - name: comment on release success id: release-pr-comment - if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} diff --git a/.github/actions/bulk-release-container/action.yaml b/.github/actions/bulk-release-container/action.yaml index ff3b8d01..8af7c079 100644 --- a/.github/actions/bulk-release-container/action.yaml +++ b/.github/actions/bulk-release-container/action.yaml @@ -379,7 +379,8 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} + ${{ !contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }} @@ -388,7 +389,7 @@ runs: - name: comment on release success id: release-pr-comment - if: ${{ (inputs.comment-enabled == 'true') && (contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published)) }} + if: ${{ inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} @@ -397,7 +398,7 @@ runs: body: | #### ${{ inputs.comment-header }} - ${{ inputs.job-name }} - :label: Commit: ${{ github.sha }} - :gear: Workflow: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) ``` - ${{ steps.semantic.outputs.git-tag }} + ${{ fromJSON(inputs.release-info).git-tag }} ${{ steps.meta.outputs.tags }} ${{ env.EXTRA_META }} ${{ steps.build-release.outputs.digest }} From fb44df8f1a79db61bfd6358d8120bb166e362328 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Fri, 31 Jan 2025 13:18:45 +0000 Subject: [PATCH 7/8] test: try updating the condition for regular releases --- .github/actions/release-chart/action.yaml | 4 ++-- .github/actions/release-container/action.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/release-chart/action.yaml b/.github/actions/release-chart/action.yaml index 6917bae1..412c69a0 100644 --- a/.github/actions/release-chart/action.yaml +++ b/.github/actions/release-chart/action.yaml @@ -319,7 +319,7 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 - if: inputs.comment-enabled == 'true' && steps.release.outcome == 'success' + if: inputs.comment-enabled == 'true' && steps.semantic.outputs.new-release-published == 'true' id: find-pr-comment with: issue-number: ${{ steps.semantic.outputs.pr-number }} @@ -328,7 +328,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' && steps.release.outcome == 'success' + if: inputs.comment-enabled == 'true' && steps.semantic.outputs.new-release-published == 'true' uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} diff --git a/.github/actions/release-container/action.yaml b/.github/actions/release-container/action.yaml index cf41c9fa..d92c531f 100644 --- a/.github/actions/release-container/action.yaml +++ b/.github/actions/release-container/action.yaml @@ -445,7 +445,7 @@ runs: - name: comment on release success id: release-pr-comment - if: inputs.comment-enabled == 'true' && steps.release.outcome == 'success' + if: inputs.comment-enabled == 'true' && steps.release.outcome == 'success' && steps.semantic.outputs.new-release-published == 'true' uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-pr-comment.outputs.comment-id }} From 23645e52a47012b98fed45b25210f68ef711ba22 Mon Sep 17 00:00:00 2001 From: rdash99 Date: Fri, 31 Jan 2025 14:06:51 +0000 Subject: [PATCH 8/8] fix: try updating the condition for bulk releases --- .github/actions/bulk-release-container/action.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/bulk-release-container/action.yaml b/.github/actions/bulk-release-container/action.yaml index 8af7c079..1bbebfa0 100644 --- a/.github/actions/bulk-release-container/action.yaml +++ b/.github/actions/bulk-release-container/action.yaml @@ -380,7 +380,6 @@ runs: - name: find pr comment uses: peter-evans/find-comment@v3 if: ${{ inputs.comment-enabled == 'true' && contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} - ${{ !contains(fromJSON('["true"]'), fromJSON(inputs.release-info).new-release-published) }} id: find-pr-comment with: issue-number: ${{ fromJSON(inputs.release-info).pr-number }}