Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

Transient "Error: Input required and not supplied: github_token" issue on pull_request_review? #53

Open
romainr opened this issue Mar 16, 2021 · 6 comments

Comments

@romainr
Copy link

romainr commented Mar 16, 2021

Hello!

First thanks got the nice project, very useful for simplifying the dev process!

One thing I could not debug successfully so far: we are seeing some "Error: Input required and not supplied: github_token" from time to time. It might be only on the "pull_request_review" events.

Would you have any idea on the root cause? Is there a way to get more debug info?
(run that failed, did not have autosquash label but another label, maybe related to label cloudera/hue#1881, note that we try to use github automerge too)

Run that failed:
https://github.com/cloudera/hue/runs/2122777923?check_suite_focus=true

All runs:
https://github.com/cloudera/hue/actions/workflows/autosquash.yml

image

Thanks!

@tibdex
Copy link
Owner

tibdex commented Mar 16, 2021

Hi Romain, I think you're running into this limitation:

With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.

Since the run that failed was for a PR coming from a fork.

@romainr
Copy link
Author

romainr commented Mar 16, 2021

Interesting, thank you!

So next step would be to see how to avoid the noise.

Those PRs don't have the 'autosquash' label, would there be a way to just output a warning and not fail? (especially if I understand correctly autosquash won't work on PR from forked repo anyway because of the GH limitation)

In general it would be nice to always be green if there is no label anyway cCould also be good to skip on forks if there is a way to detect that if previous it not possible).

What do you think?

@tibdex
Copy link
Owner

tibdex commented Mar 17, 2021

This issue is not specific to Autosquash so I would rather not add some feature to it to make it a no-op when it detects that it's running on a fork.

You might be able to add another custom action before Autosquash in your workflow to exit it early when it's running on a fork.

@romainr
Copy link
Author

romainr commented Mar 17, 2021

Ok, just for information it makes it too noisy to use on repos with a lot of open source activity as even PRs not labeled with 'autosquash' are affected.

@tibdex
Copy link
Owner

tibdex commented Mar 17, 2021

You can use an if conditional like explained here.

romainr added a commit to cloudera/hue that referenced this issue Mar 17, 2021
romainr added a commit to cloudera/hue that referenced this issue Mar 17, 2021
@romainr
Copy link
Author

romainr commented Mar 19, 2021

Thanks for the hint, trying it!

Main issue is that it is the other way around:
"The property github.repository of the github context 67 can return name of the repository where the workflow is running."

So will see if there is a way to get the name of the forked repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants