Skip to content

Conversation

@noisysocks
Copy link
Member

The Sync Issue step in the Sync Core Backport Issue workflow wasn't working.

In 8bb22a2 this step was made conditional so that it would only run if there are changes within the backport-changelog directory.

But, for example, it didn't run here even though there were changes in the backport-changelog directory:

https://github.com/WordPress/gutenberg/actions/runs/9950072850/job/27487350407

To fix, I've updated the step's if to use steps.$id.outputs.$var instead of env.$var. This is what's in the GitHub Actions docs.

I tested this in a fork of Gutenberg. You can see the step correctly being skipped when there are no changes here:

https://github.com/noisysocks/gutenberg/actions/runs/10034541947/job/27729221457

And you can see the step correctly running when there are changes here:

https://github.com/noisysocks/gutenberg/actions/runs/10034606864/job/27729375022

(The step then fails for some reason, but we only care that it isn't skipped.)

@noisysocks noisysocks added [Type] Bug An existing feature does not function as intended GitHub Actions Pull requests that update GitHub Actions code labels Jul 22, 2024
@noisysocks noisysocks self-assigned this Jul 22, 2024
@noisysocks noisysocks requested a review from desrosj as a code owner July 22, 2024 04:33
@github-actions
Copy link

github-actions bot commented Jul 22, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@noisysocks
Copy link
Member Author

(The step then fails for some reason, but we only care that it isn't skipped.)

Looks like this is because issue.body can be null if issue has no description. Added a fix in 4350f0f. Here's it working:

https://github.com/noisysocks/gutenberg/actions/runs/10034745885/job/27729718762

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@noisysocks noisysocks enabled auto-merge (squash) July 22, 2024 05:14
@noisysocks noisysocks merged commit 18c5c6a into trunk Jul 22, 2024
@noisysocks noisysocks deleted the fix/sync-backport-changelog-action branch July 22, 2024 05:18
@github-actions github-actions bot added this to the Gutenberg 18.9 milestone Jul 22, 2024
@ellatrix
Copy link
Member

Why does it not work here. Env should work just fine, like here:

echo "conflict=false" >> $GITHUB_ENV
echo "cherry_pick_sha=$CHERRY_PICK_SHA" >> $GITHUB_ENV
git push origin $TARGET_BRANCH
fi
- name: Remove cherry-pick label
if: env.cherry_pick == 'true' && env.conflict == 'false'

@noisysocks
Copy link
Member Author

Hmm. The example you linked to uses $GITHUB_ENV whereas here we're using $GITHUB_OUTPUT. Maybe it's just that.

@priethor priethor added [Type] Project Management Meta-issues related to project management of Gutenberg and removed [Type] Bug An existing feature does not function as intended labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GitHub Actions Pull requests that update GitHub Actions code [Type] Project Management Meta-issues related to project management of Gutenberg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants