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

chore(action): bind debug input to action debug #2829

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

fty4
Copy link
Member

@fty4 fty4 commented Jan 17, 2024

description

When an action will be executed in debug mode (e.g. via GitHub UI) the secret ACTIONS_STEP_DEBUG will be set to true (empty if not enabled). This typically will allow to detect if a run is in debug mode. Because a GitHub action can not automatically read secrets the runner.debug variable needs to be used to determine if debug mode is enabled.

When using this as default for the debug input of the action the debug will automatically be forwarded to SecHub.

Overwriting is always possible for the endusers because it is only the default setting of this action.

This change was already tested within GHE.

useful links

limitation

The only problem here is that instead of a not existing steps.debug variable the runner.debug variable is used.
For debugging steps the usage of the steps context would be better here - but because this context does not offer a debug property we are using the runners property here.
Because when the debug is enabled via UI (I guess this is the most common approach) it will trigger the debug mode for this action as well (...but via the runner).

re-run (failed) jobs popup

image

additonal information

Because the runner.debug returns a 1 a expression is used to make a boolean out of it.


Marco Lecheler marco.lecheler@mercedes-benz.com Mercedes-Benz Tech Innovation GmbH (ProviderInformation)

When an action will be executed in debug mode (e.g. via GitHub UI) the secret `ACTIONS_STEP_DEBUG` will be set to true (empty if not enabled).
This typically will allow to detect if a run is in debug mode.
Because a GitHub action can not automatically read secrets the `runner.debug` variable needs to be used to determine if debug mode is enabled.

When using this as default for the debug input of the action the debug will automatically be forwarded to sechub.

Overwriting is always possible for the endusers because it is only the default setting of this action.
@de-jcup
Copy link
Member

de-jcup commented Jan 23, 2024

@fty4 : First of all: Thank you for the contribution.

Currently I am extremely refactoring the complete github action (more scan types, provide an integration test to run/test it at local machine (mocking automatically GH actions) and much more).

When I have done the refactorings and the improvements, I will return to this PR and give you feedback/discuss further steps etc.

Sorry for the inconvenience/the delay...

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

Successfully merging this pull request may close these issues.

None yet

2 participants