-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
on event push without PRs fallback to 0 #354
Comments
Hey @fulgas, TF-via-PR explicitly supports both This includes fetching the PR number associated with a commit, even from What's more, TF-via-PR also has a fallback of Are you able to share a little more about your workflow, with (obfuscated) snippets to aid troubleshooting. |
I'm running a This is the identifier for the file The |
Hmm, that doesn't sit right. Could you:
I'm apprehensive of adding in a fallback to gh api /repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls |
This is not your typical workflow as you showed on the examples. I have 2 workflows, one for CI which runs on PR and produces the tf plan, and another workflow for CD that actually applies the plan. The difference here is that besides that i am allowing to push directly to the main branch even when no PR is associated. |
The result is the same: I can try to play with |
This call returns |
Admittedly, I haven't yet run into the use case of having a CI workflow as well as another workflow which circumvents it altogether. I'm afraid neither Before working on a solution, could you share more details around pipeline flow and expectations?
|
This pipeline will run a
No PR
No
No auto approve. |
Works as i expected if i apply on the
I can live with the |
No way, I didn't think that approach would've worked, but you figured out a resolution yourself?! Is there anything else to help with? |
All good. Thk for the help :) |
Thank you for demonstrating a new use case! If the current identifier-naming strategy doesn't work out, feel free to drop us another message—happy to amend based on feedback. |
Although, you've managed to solve this, others (i.e., me) might've been stuck. And given the simplicity—just push to main—I think this use case should be accounted for without resorting to As per your suggestion, the PR number now falls back on Happy to share this has been shipped with v12.0.7, where your contribution has been credited! |
Is your feature request related to a problem
When there is a push to the main branch and there is no PR associated with it, the PR Number is null.
Describe the solution you'd like
Is it possible to use a fallback to 0 ?
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: