@@ -86,38 +86,55 @@ jobs:
86
86
needs : semver-pull-request-check
87
87
timeout-minutes : 3
88
88
steps :
89
+ - name : Get ID of comment if posted previously.
90
+ uses : peter-evans/find-comment@v3
91
+ id : find-comment
92
+ with :
93
+ issue-number : ${{ env.PR_ID }}
94
+ comment-author : ' github-actions[bot]'
95
+ body-includes : semver
89
96
- name : Remove breaking label on success
90
97
run : gh pr edit "$PR_ID" --remove-label semver-checks-breaking
91
98
if : needs.semver-pull-request-check.outputs.exitcode == '0'
92
99
env :
93
100
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
101
GH_REPO : ${{ github.repository }}
102
+ - name : Report that there were no breaks
103
+ uses : peter-evans/create-or-update-comment@v4
104
+ with :
105
+ issue-number : ${{ env.PR_ID }}
106
+ comment-id : ${{ steps.find-comment.outputs.comment-id }}
107
+ body : |
108
+ `cargo semver-checks` found no API-breaking changes in this PR! 🎉🥳
109
+ Checked commit: ${{ env.PR_HEAD }}
110
+ edit-mode : replace
111
+ if : needs.semver-pull-request-check.outputs.exitcode == '0'
95
112
- name : Add breaking label on failure
96
113
run : gh pr edit "$PR_ID" --add-label semver-checks-breaking
97
114
if : needs.semver-pull-request-check.outputs.exitcode != '0'
98
115
env :
99
116
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100
117
GH_REPO : ${{ github.repository }}
101
118
- name : Post report on semver break
102
- run : |
103
- gh pr comment "$PR_ID" --body "\
104
- \`cargo semver-checks\` detected some API incompatibilities in this PR.
105
- See the following report for details:
106
- <details>
107
- <summary>cargo semver-checks output</summary>
119
+ uses : peter-evans/create-or-update-comment@v4
120
+ with :
121
+ issue-number : ${{ env.PR_ID }}
122
+ comment-id : ${{ steps.find-comment.outputs.comment-id }}
123
+ body : |
124
+ `cargo semver-checks` detected some API incompatibilities in this PR.
125
+ Checked commit: ${{ env.PR_HEAD }}
108
126
109
- \`\`\`
110
- $SEMVER_OUTPUT
111
- \`\`\`
127
+ See the following report for details:
128
+ <details>
129
+ <summary>cargo semver-checks output</summary>
112
130
113
- </details>
114
- "
115
- if : needs.semver-pull-request-check.outputs.exitcode != '0'
116
- env :
117
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118
- GH_REPO : ${{ github.repository }}
119
- SEMVER_OUTPUT : ${{ needs.semver-pull-request-check.outputs.output }}
131
+ ```
132
+ ${{ needs.semver-pull-request-check.outputs.output }}
133
+ ```
120
134
135
+ </details>
136
+ edit-mode : replace
137
+ if : needs.semver-pull-request-check.outputs.exitcode != '0'
121
138
122
139
semver-push-tag :
123
140
runs-on : ubuntu-latest
0 commit comments