-
Notifications
You must be signed in to change notification settings - Fork 155
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
Can't get PR evaluation to run in dry-run mode (run via GitHub actions) #739
Comments
I can't share own run since it's in a private organization, but it's identical to what we see here (PR evaluation on branch),
|
Regarding the issue where safe-settings doesn't execute in nop (dry-run) mode (when running |
@decyjphr - Regarding the issue with the I'd be happy to contribute to fixing this. We can we start by creating a dedicated issue to discuss the implementation details, since we currently can't retrieve the context in the same way as with event handlers. @sumokadet - Would adding an environment variable to specify which ref to use for settings meet your needs? Note: This change would also require addressing the Please let me know your thoughts on this approach. P.S. @decyjphr - I realize I might be tagging you too frequently. Please let me know if this is bothersome - I'm still learning how best to collaborate in open source and want to be respectful of everyone's notifications. |
@PendaGTP - Thanks and kudos for quick response! The combination of input env vars From a "user perspective" in a workflow it could probably look a little bit like this. It would be nice if env:
...
FULL_SYNC_NOOP: ${{ github.event_name == 'pull_request' && 'true' || 'false' }} # Or just "real" bool type?
FULL_SYNC_FROM_REF: ${{ github.ref }} |
Thanks for your feedback! I think one thing that could also help from a user perspective would be to create a GitHub Action. This way, the user would only need to provide the necessary inputs and the action would take care of the rest logic/setup. Any thoughts on this approach? I'd be happy to create an issue to discuss this further and potentially submit a PR with a GHA implementation if this seems like a helpful direction to pursue. |
Problem Description
We can't get safe-settings to run in dry-run (nop?) mode when evaluating pull requests on topic branch, run via GitHub actions. It always enforces the rules for both github triggers
pull_request
andpush
from main branch even though on topic branch.Are we missing a setting?
We are on rc version
2.1.15-rc.1
, feel free to discard this issue if we are reporting it premature. We are ready to wait for future versions, I just wanted to report this back. Great work by the way! 👍What is actually happening
We see that the settings evaluated are not from the topic branch (they are from main branch) and that the debug statements display that it is not run in nop mode. Any changes are enforced from main branch even though it's evaluation intended.
It's as if it doesn't recognize that it should be run in dry-run (nop) mode and picks up the topic branch name.
What is the expected behavior
That when run with event trigger is
pull_request
that the settings evaluated will be from the topic branch (not main branch) and that the changes on topic branch ARE NOT enforced, just gets output on the PR.Error output, if available
The log from full-sync.js when evaluating a pull request with
LOG_LEVEL: debug
displays thata) The GET statement doesn't invoke the GitHub api for topic branch, but just main branch. I would expect that it tried to look the file from
?ref=topic-branch
or something like thatb) The output from probat displays it's not run in nop:
Context
Running on GitHub Enterprise. Running safe-settings via GitHub Action. Run with pull_request trigger.
Run with settings mentioned in example file. Almost as example. The admin repo has a custom name.
The text was updated successfully, but these errors were encountered: