-
Notifications
You must be signed in to change notification settings - Fork 135
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
[bug] detect-env fails on pull-request, only works on tag #1527
Comments
It would be very helpful if the cc @sethmlarson |
Hi @davidism, Our lack of support for pull requests is due to a limitation in the permissions given to GitHub tokens for
We do have some documentation about supported triggers/events here. Let us know if there is something we can do to make those docs more discoverable.
It is a bit confusing since most of the pull request logic there is to help the workflows work with our own pre-submit tests. I'll see if we can't improve those error messages.
I'm curious why you need to do this. Is it necessary to do this to support a new version of Python? |
Sorry about that, I totally missed that I'll explain Python builds a bit. Unless you're using the special abi3 mode (MarkupSafe can't), you need to build a platform wheel for each Python X.Y version, OS, and architecture triple, which requires running the build on each combo. The cibuildwheel project automates this. There are no actual code changes needed to build against a new Python version, only the latest version of cibuildwheel. So if Python 3.12 comes out, I can just create a PR to update cibuildwheel, which would trigger the build workflow, then upload the new 3.12 artifacts for the existing tag/version. But I also missed that the generator does support |
That being said, I do think that as we migrate to v1.0 provenance and use our internal signing action, we will likely be able to support |
To run against a specific commit/tag in |
If you can use There's also I would recommend not using |
|
Thanks @davidism for reaching out. Closing the issue then. |
While setting up the generic generator workflow for MarkupSafe, I used the
on: pull-request:
trigger so that I could debug it by pushing more to the PR. However, it failed because the detect-env job returned my repository rather than the generator repository. When I switched toon: push: tags
, the job succeeded.Documentation doesn't seem to indicate that only tags are supported, and looking at the detect-workflow source shows that it should work with
pull-request
:slsa-github-generator/.github/actions/detect-workflow/main.go
Line 99 in d3868d6
Here's the output of detect-env on a failed run triggered by a pull request event: https://github.com/davidism/markupsafe/actions/runs/3904391874/jobs/6670129941#step:3:7, it returns
davidism/markupsafe
.And here's the output on a successful run triggered by a tag instead: https://github.com/davidism/markupsafe/actions/runs/3904749127/jobs/6670933961#step:3:7, it returns
slsa-framework/slsa-github-generator
.It was also very hard to debug this because the output was not helpful. It showed the detect-env job passing, then the generator job failed with the error
Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/markupsafe/markupsafe/__BUILDER_CHECKOUT_DIR__/.github/actions/privacy-check'. Did you forget to run actions/checkout before running your local action?
https://github.com/davidism/markupsafe/actions/runs/3904391874/jobs/6670142285#step:2:239The text was updated successfully, but these errors were encountered: