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

Enable debug mode for GitHub Actions #220

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Enable debug mode for GitHub Actions #220

merged 1 commit into from
Dec 16, 2022

Conversation

ghostwriter
Copy link
Contributor

  • Check if the environment variable ACTIONS_RUNNER_DEBUG is present, to set the log level to DEBUG mode via GitHub Actions.
  • Note: it does not overwrite the default LOG_LEVEL environment variable.

Signed-off-by: Nathanael Esayeas <[email protected]>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever usage of the debug flag of github actions: nice!

@Ocramius Ocramius added this to the 1.20.0 milestone Dec 16, 2022
@Ocramius Ocramius self-assigned this Dec 16, 2022
@Ocramius Ocramius merged commit 49d9580 into laminas:1.20.x Dec 16, 2022
@boesing
Copy link
Member

boesing commented Dec 16, 2022

I'd say we should enable debug logging in every case.
What I experienced many times now was, that the action creates the git tag and then fails to create the release on github due to the API is not providing the expected status code.

If you then "re-run" the action again with the debug flag, git tag command will fail and you only get debug up to the git tag error but you are unable to understand the invalid API response error.

@Ocramius
Copy link
Member

I'd be up for it: was hesitant because I'm worried about secret leaks in logs.

I already hardened the logger against it:

return $item->getMethod()
. ' '
. $item
->getUri()
->withUserInfo('')
->__toString();

If this filtering is sufficient for our future use-cases, then we should be OK with having verbose logging at all times.

@Ocramius
Copy link
Member

Another thing to think about is if we can re-design the default pipeline so it is in "stages" that can be retried individually 🤔

@boesing
Copy link
Member

boesing commented Dec 16, 2022

I guess that would be the best. Or at least having checks like "does tag already exist then assume tagging was successfully"?
If a tag is available thats most probably because something went wrong earlier OR some1 failed setting up his project.
Maybe double-checking if the current commit is the same commit which is already tagged or sth. like this.

@ghostwriter ghostwriter deleted the feature/debug-github-actions branch December 16, 2022 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants