github-actions-demo icon indicating copy to clipboard operation
github-actions-demo copied to clipboard

GitHub- vs Self-Hosted detection is inaccurate.

Open MarkLodato opened this issue 3 years ago • 1 comments

The detection of GitHub-hosted runner vs Self-hosted runner is inaccurate. What we want to know is "did all jobs use GitHub-hosted runners?" Instead, the current code says "does the current job (creating the provenance) use a GitHub-hosted runner." Is it possible to actually check what we need?

An ugly idea is to parse the yaml to check all the runs-on fields, but that both (a) requires fetching and parsing the yaml, which is terrible, and (b) properly identifying which are github-hosted and which are self-hosted.

Any better ideas?

MarkLodato avatar Sep 17 '21 17:09 MarkLodato

Another idea: Download all workflow run logs. The first line indicates whether it's github- or self-hosted. That would require the provenance generator to have access to the logs, which is not ideal, and when doing it mid-run, I'm not sure if there are race conditions where that wouldn't work well.

MarkLodato avatar Sep 17 '21 17:09 MarkLodato