-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Bugfix FXIOS-13835 Fix Github workflow errors on forks #29968
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
Bugfix FXIOS-13835 Fix Github workflow errors on forks #29968
Conversation
+cc @janbrasna |
🧹 Tidy commitJust 1 file(s) touched. Thanks for keeping it clean and review-friendly! ✅ Per-file coverageAll changed files meet the threshold of 35.0%. Generated by 🚫 Danger Swift against d75292f |
@mattreaganmozilla since we almost never push directly to main and changes always come from merged PRs, wouldn't it be easier to listen for push on main ? Then we won't have the problem of having to check all the base refs and for forks since we are guaranteed to always run from our repo's scope . I think we can get the PR number from a merged commit by using something like this: gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number' |
@issammani I think I understand what you're suggesting but this is slightly outside my wheelhouse, I'm not well-versed with Github Actions. Does this (below) look more like what you had in mind? +cc @janbrasna Maybe you can also chime in with thoughts/feedback.
|
@mattreaganmozilla exactly. This looks good to me. |
a214bfb
to
d75292f
Compare
I've updated the yml per the above discussion. @janbrasna Can you please LMK if you have any objections or concerns with this approach? Thank you all |
Oh go for it! From security standpoint it's better to run privileged defaults off of main push (=trusted actor) than working around pr triggers with varying scopes still running just on the merge head even after merging;) — I'm not familiar with the search params if they also include the squashed commit as "pull requests that contain that SHA" but that's normal with GH docs;D YOLO and see how that works. (I might have naïve questions about some of the empty value conditions, passing the token, or if the gh cli automatically filters the interaction to the repo running it by default, but that's not important if this works as is, I can see about the defaults and implicit scopes later.) But this seems indeed solid:
🚀 |
@mozilla-mobile/fxios-automation @clarmso Can we please get a review of this? Thank you 🙏 |
🚀 PR merged to |
📜 Tickets
Jira ticket
💡 Description
Fix error on forks, move workflow trigger to main.
📝 Checklist