Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify conditions for release PR comments #186

Merged
4 changes: 2 additions & 2 deletions .github/actions/bulk-release-chart/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/bulk-release-container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -397,7 +397,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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/release-chart/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/release-container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bulk-pr-and-release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bulk-pr-and-release-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Loading