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

in PR checks Error: Failed to get ID token: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable #184

Open
lectrical opened this issue Dec 11, 2024 · 3 comments

Comments

@lectrical
Copy link

I was looking to add attestations to jqlang/jq#3220 and it fails in the PR checks but works in the downstream repo.

The error seems to be the same as seen when not providing correct permissions, though they are present.

permissions:
  id-token: write
  contents: read
  attestations: write

https://github.com/jqlang/jq/actions/runs/12267835999/job/34228631988?pr=3220

The changes

https://github.com/jqlang/jq/pull/3220/files

Am i overlooking something here? As in this in an intended or unintended outcome.

I did not see anything gin the readme to suggest a solution

https://github.com/actions/attest?tab=readme-ov-file#actionsattest

What is the correct way forward to allow attestations in a pr action check or should this be avoided?

Thanks in advance.

@bdehamer
Copy link
Collaborator

I think this is a limitation of the id-token: write permission when operating in a forked repo. There is some more information here which may be useful.

@lectrical
Copy link
Author

lectrical commented Dec 11, 2024

So it's probably best to have some conditions to skip running on a pr and move on?

I think there is some sense to have pr artifacts attested but probably not as important as release assets.

@jsoref
Copy link

jsoref commented Jan 23, 2025

If you really need to do things, you can, but, it's dangerous. I left an outline in:

Personally, I wouldn't do this. I'd instead have another fork (possibly in a different organization) and have that one be responsible for building and attesting things from untrustworthy sources -- probably by adding an if to the very-dangerous job that skips my owner repository: if: github.repository_owner != 'my-source', and then when I get a PR to my-source/repo, I can make an equivalent PR to my-untrusted-source/repo and let people get artifacts from there.

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