Skip to content

Commit

Permalink
fix: tag codeowner for all release ci runs that are not success (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Feb 8, 2023
1 parent dc73ffe commit 241dbf2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -368,7 +368,6 @@ jobs:
- name: Get Needs Result
id: needs-result
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
Expand Down Expand Up @@ -397,7 +396,8 @@ jobs:
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`)
if (RESULT === 'x') {
const tagCodeowner = RESULT !== 'white_check_mark'
if (tagCodeowner) {
body += `\n\n:rotating_light:`
body += ` @npm/cli-team: The post-release workflow failed for this release.`
body += ` Manual steps may need to be taken after examining the workflow output`
Expand Down
4 changes: 2 additions & 2 deletions lib/content/release.yml
Expand Up @@ -172,7 +172,6 @@ jobs:
- name: Get Needs Result
id: needs-result
run: |
result=""
if [[ "$\{{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "$\{{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
Expand Down Expand Up @@ -201,7 +200,8 @@ jobs:
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`)
if (RESULT === 'x') {
const tagCodeowner = RESULT !== 'white_check_mark'
if (tagCodeowner) {
body += `\n\n:rotating_light:`
body += ` {{ codeowner }}: The post-release workflow failed for this release.`
body += ` Manual steps may need to be taken after examining the workflow output`
Expand Down
12 changes: 6 additions & 6 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Expand Up @@ -1122,7 +1122,6 @@ jobs:
- name: Get Needs Result
id: needs-result
run: |
result=""
if [[ "\${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "\${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
Expand Down Expand Up @@ -1151,7 +1150,8 @@ jobs:
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
if (RESULT === 'x') {
const tagCodeowner = RESULT !== 'white_check_mark'
if (tagCodeowner) {
body += \`/n/n:rotating_light:\`
body += \` @npm/cli-team: The post-release workflow failed for this release.\`
body += \` Manual steps may need to be taken after examining the workflow output\`
Expand Down Expand Up @@ -2707,7 +2707,6 @@ jobs:
- name: Get Needs Result
id: needs-result
run: |
result=""
if [[ "\${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "\${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
Expand Down Expand Up @@ -2736,7 +2735,8 @@ jobs:
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
if (RESULT === 'x') {
const tagCodeowner = RESULT !== 'white_check_mark'
if (tagCodeowner) {
body += \`/n/n:rotating_light:\`
body += \` @npm/cli-team: The post-release workflow failed for this release.\`
body += \` Manual steps may need to be taken after examining the workflow output\`
Expand Down Expand Up @@ -4135,7 +4135,6 @@ jobs:
- name: Get Needs Result
id: needs-result
run: |
result=""
if [[ "\${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "\${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
Expand Down Expand Up @@ -4164,7 +4163,8 @@ jobs:
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
if (RESULT === 'x') {
const tagCodeowner = RESULT !== 'white_check_mark'
if (tagCodeowner) {
body += \`/n/n:rotating_light:\`
body += \` @npm/cli-team: The post-release workflow failed for this release.\`
body += \` Manual steps may need to be taken after examining the workflow output\`
Expand Down

0 comments on commit 241dbf2

Please sign in to comment.