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

Update CI to by default, reference it's own calling branch e.g. @main or @some-branch, if not provide an option to test a different branch #62

Closed
keevan opened this issue Jul 26, 2022 · 3 comments · Fixed by #69
Assignees

Comments

@keevan
Copy link
Contributor

keevan commented Jul 26, 2022

This should alleviate some annoyances when it comes to testing a workflow PR, because many of the references in ci.yml reference the main branch of the workflows.

This potentially could be another option provided to ci.yml but defaulting to main.

A better option would be to default to whatever the current reusable workflow branch it is currently on, but unsure if there's an option for that.

@keevan keevan changed the title Update CI to by default, reference it's own calling branch, if not provide an option to test a different branch Update CI to by default, reference it's own calling branch e.g. @main or @some-branch, if not provide an option to test a different branch Jul 26, 2022
@brendanheywood
Copy link
Contributor

+1

@keevan
Copy link
Contributor Author

keevan commented Aug 2, 2022

Was about to create another issue but adding details to this is better:

Apparently this "problem" has been resolved https://github.blog/changelog/2022-01-25-github-actions-reusable-workflows-can-be-referenced-locally/ so we should be able to point the actions used locally and it should just work, which means we shouldn't need yet another branch with pointers to our test branch to ensure actions are working.

If what I just said sounded messy, it really was and so fixing this should make it so if you created a PR with some changes, you only need to point the CI at the PR branch, and it should just work.

@keevan keevan self-assigned this Aug 2, 2022
@keevan
Copy link
Contributor Author

keevan commented Aug 2, 2022

So previous link though true, didn't really work in this case.

I did try various options provided on StackOverflow:

Ultimately, it only worked in using what was available in the plugin repo, not the reusable one which was what I wanted instead. I combined a bit of this and that, and I believe I've found a mix that is "good enough" for now. It does require an option to be passed through, slightly redundant as there didn't seem to be any direct way of referencing that piece of information. A slightly better option considered was parsing the ci file that was called from the plugin, and wrangling the branch name out of the use line but that seems more likely to have issues, at least initially.

The changes will come in at the same time as the phpdoc fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants