-
Notifications
You must be signed in to change notification settings - Fork 51
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
Running the action optionally, including pre and post scripts #493
Comments
Thank you for raising this issue! You’re correct that pre-if and post-if could potentially enable conditional execution of the pre and post scripts. We’ll experiment with implementing pre-if and post-if to see if it can address your use case effectively. Once we’ve explored this approach and validated whether it works as expected, we’ll update you here with our findings or next steps. Out of curiosity, could you share a bit more about your use case for conditional execution? Understanding why you’re looking to enable or disable Harden-Runner in certain scenarios will help us provide an alternate solution in case pre-if/ post-if does not work. |
Thank you!
The problem for us is runtime. Having multiple repos and quite a number of action workflows, each starting out with hardening the runner, the setup runtime of ~3m has become a noticeable portion of the billing time. So instead of removing the step from our workflows we wanted to make it optional… |
From the attached screenshot, i can see the workflow is container-based, currently harden-runner doesn't supports Can you please attach screenshot of logs from pre-step ? I am just curious what's happening in there. |
As in debug logs when I rerun the workflow? |
I should mention that we’re running v1.5.0 so we have:
|
These appears to be interesting logs. Ideally harden-runner shouldn't have logged them in-case of container-based workflows because of a conditional-check.
I tried running v1.5.0 on my test workflow, it appears to be working fine checkout this run. If possible can you run the workflow with v2.10.2 ? Anyways i will keep updated. Just curious are you guys using Thanks |
Try adding an if: ${{ false }} or some such here. It should still run the pre- and post-steps, which is what we’d like to avoid. |
@jenstroeger harden-runner should not be taking 3m. This is likely because of use of a very old version v1.5 which uses node16. Once you upgrade to the latest version, it should not take more than 5-7 seconds. Please let us know if this is not the case. Given that updating to a more recent version should fix the root cause, we would prefer to not spend time researching/ implementing optional execution.
|
We tried to make running Harden Runner optional:
However, this seems to impact only the main script and not the pre & post scripts
harden-runner/action.yml
Lines 37 to 39 in 0080882
Is there a way to en/disable all of them? The
runs
documentation mentionspre-if
andpost-if
and I’m not quite sure if this is something we ought to implement, or the action?Do you guys have a suggestion?
The text was updated successfully, but these errors were encountered: