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

Make Job Summary Reporting Configurable in Harden Runner #491

Open
pputman-clabs opened this issue Dec 19, 2024 · 3 comments
Open

Make Job Summary Reporting Configurable in Harden Runner #491

pputman-clabs opened this issue Dec 19, 2024 · 3 comments

Comments

@pputman-clabs
Copy link

pputman-clabs commented Dec 19, 2024

In a workflow with two jobs, both with harden runner activated, one of them prints a summary to the github actions workflow summary, and the other does not. It is because of this environment variable, but not sure how or where this is set. This is set for the first job in the logs, and not the second job.
image

could you add an input into the github action to set this, or document how this is determined? Both instances the action is called with the same options so not sure what the difference is.

@pputman-clabs
Copy link
Author

pputman-clabs commented Dec 19, 2024

The variable I'm referring to is STATE_addSummary

@varunsh-coder
Copy link
Member

Thank you @pputman-clabs for reaching out!

The behavior you're seeing is intentional. To keep the GitHub Actions workflow summary uncluttered, Harden-Runner prints the summary for only one job — the first job where the action runs. This prevents multiple entries from being added to the summary when Harden-Runner is used in several jobs.

While the workflow summary shows a preview with key details from one job, you can view complete insights for all jobs by clicking the provided link to the detailed insights page.

Technical details

This first job of a workflow gets a true response for this attribute

`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`,

addSummary = responseData.monitoring_started ? "true" : "false";

`addSummary=${addSummary}${EOL}`,

and if the variable is true, the markdown is rendered for that job

await common.addSummary();

export async function addSummary() {

@pputman12
Copy link

Thanks for the comment. It would be nice to have this configurable. In my case, the first job is just go-tests, which isn't the main concern, then a docker build and deploy which I'd much rather have a report of, however since all jobs will have it in the insights this isn't really a huge concern, just a "nice to have" if possible.

@varunsh-coder varunsh-coder changed the title Not clear how the ability to add summary is generated Make Job Summary Reporting Configurable in Harden Runner Dec 23, 2024
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

No branches or pull requests

3 participants