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

.github/workflows/merge-staging.yml: Include branch in comment #122814

Merged
merged 1 commit into from May 14, 2021

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented May 13, 2021

Motivation for this change

If I receive the mail notification that staging(-next) merge failed, I either need to check git log staging-next or click the action run link to find out where should I resolve the conflict.

To save time, let’s include the information about which step failed right in the comment.

Things done

Tested in: jtojnar/repro#2

If I receive the mail notification that staging(-next) merge failed,
I either need to check `git log staging-next` or click the action run link
to find out where should I resolve the conflict.

To save time, let’s include the information about which step failed right in the comment.
@jtojnar
Copy link
Contributor Author

jtojnar commented May 13, 2021

Switched from JSON object access

fromJSON('{"true-false": " from master to staging-next", "false-true": " from staging-next to staging"}, "false-false": ""}')[format('{0}-{1}', steps.staging_next.outcome == 'failure', steps.staging.outcome == 'failure')]

to short-circuiting boolean operators, which makes it almost slick:

(steps.staging_next.outcome == 'failure' && ' from master to staging-next') || ((steps.staging.outcome == 'failure' && ' from staging-next to staging') || '')

@domenkozar domenkozar merged commit a96c617 into NixOS:master May 14, 2021
@jtojnar jtojnar deleted the staging-merge-comment branch May 18, 2021 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants