Skip to content

Commit

Permalink
lib.ts: adjust status logging levels (#1033)
Browse files Browse the repository at this point in the history
GitHub reports when workflow runs log messages with `notice` or higher
logging levels, e.g.:

> There are 0 failures, 0 warnings, and 1 notices.

Since `notice` was being used regardless of status, these reports were
misleading, because everything was working correctly on successes and
no-ops.

Therefore, the successes and no-ops now only log with `info`, and the
failures now only log with `notice`.
  • Loading branch information
hemberger authored Feb 16, 2022
1 parent 76a601a commit 642a797
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,13 @@ export default async function run(

setFailed(extractErrorMessage(error))
} finally {
const terminationMessage = `${
status === Status.FAILED
? 'Deployment failed! ❌'
: status === Status.SUCCESS
? 'Completed deployment successfully! ✅'
: 'There is nothing to commit. Exiting early… 📭'
}`

info(terminationMessage)
notice(terminationMessage)
if (status === Status.FAILED) {
notice('Deployment failed! ❌')
} else if (status === Status.SUCCESS) {
info('Completed deployment successfully! ✅')
} else {
info('There is nothing to commit. Exiting early… 📭')
}

exportVariable('deployment_status', status)
setOutput('deployment-status', status)
Expand Down

0 comments on commit 642a797

Please sign in to comment.