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 newline at end of folded env variable string and prevent confusing skips of the changelog PRs #3789
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I don't think this will work because newline chomping isn't supported in the GHA YAML spec 😞 see: #3702
Whaaat! That's wild! I'll just convert it to a single line then. |
Kudos @AetherUnbound for picking this up before and remembering it
@@ -122,14 +122,13 @@ jobs: | |||
|
|||
- name: Open changelog PR | |||
uses: peter-evans/create-pull-request@v5 | |||
if: "!cancelled()" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why this was removed -- it sounds like it relates to this part of the description:
This PR also fixes the changelog PR step to only run if the rest of the workflow completes
Was this check broken and is no longer necessary? Is it related to the critical bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't part of the critical bug, but it doesn't make sense at all, !cancelled
would also run if the workflow fails, which you can see in the linked failure. That doesn't make sense: if we skip the changelog when we cancel the release workflow, why would we want it if the release workflow failed? We can close the PR if we don't want the changelog, and we'll need to delete the tag in that case too anyway (and generate a new drafted release when we push whatever fix we need).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we skip the changelog when we cancel the release workflow, why would we want it if the release workflow failed?
Agree with the logic here, although I don't understand how removing this check does what is described in the PR description (actually preventing the step from running if the rest of the workflow hasn't completed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because !cancelled()
is strictly only if the workflow isn't cancelled, meaning it still runs if the workflow failed. I don't know how this is the case, but you can see it in the linked failure, where a previous step in the workflow fails but the changelog PR step still runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that and agree it's not useful to only check that case. I assumed (I think wrongly?) that removing this check would mean that now it will run in all cases, not that it would only run if the previous steps completed as described.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! The default behaviour is to run only if the previous step succeeded, in effect having if: success()
by default (https://docs.github.com/en/actions/learn-github-actions/expressions#success).
To run something in every case, you'd have to explicitly use always
: https://docs.github.com/en/actions/learn-github-actions/expressions#always
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes
Fixes https://github.com/WordPress/openverse/actions/runs/7879001320/job/21498432707
Description
Releases currently fail to complete due to the
env.APP_NAME
having a newline at the end of the string: https://github.com/WordPress/openverse/actions/runs/7879001320/job/21498432707Converting it to a single line is necessary because, as Madison pointed out, you cannot use a chomped multiline string (
>-
) in GitHub actions.This PR also fixes the changelog PR step to only run if the rest of the workflow completes and to use the correct variable in place of
git-tag
. I searched for other usages ofgit-tag
to be sure and those were the last remaining ones.Testing Instructions
Confirm the change will work as expected based on the information about yaml multiline strings in the linked documentation.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin