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

Windows ci fail on forked pr #791

Closed
wants to merge 5 commits into from

Conversation

nerdvegas
Copy link
Contributor

Fixes #790 (sort of)

This is a fairly hacky fix for failing windows tests, but there don't seem to be many good options.

Windows test is failing on forked PRs, because forks don't have access to secrets, and thus secrets.DOCKERHUB_TOKEN evals to empty string.

This PR forces the windows test to be a no-op in this situation. It's not ideal, but neither is removing pull-requests as an event, because this should be working for collaborators and it would be a shame to lose that.

The clumsy approach you see wrt setting DOCKERHUB_TOKEN envvar in each step is explained here: https://gh.neting.ccmunity/t5/GitHub-Actions/If-expression-with-context-variable/td-p/34556. Basically, you can't use jobs.{jobname}.if because this doesn't have access to the secrets context (why??).

Anyway the aim of this PR is to have windows test in as good a shape as it can be currently. Happy to revert this to something else later.

ps:

It's also not great because the fork user may have an unrelated DOCKERHUB_TOKEN secret. Chances of that are low, and this is hopefully a semi-temporary fix, so I think we can live with this for now. Unfortunately there's no such thing as a 'user' context in github Actions where you might check user permissions and have an if condition on that :/

@nerdvegas nerdvegas requested a review from bfloch November 8, 2019 04:20
@bfloch
Copy link
Contributor

bfloch commented Nov 8, 2019

Sad to see this happening. Do we actually need to login to pull public images from docker hub at all? I am not an expert here but maybe we can get rid of the login all together for the pull.

bfloch
bfloch previously approved these changes Nov 8, 2019
Copy link
Contributor

@bfloch bfloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the change. Like mentioned - maybe we don't need a login at all for the pull. Have not tried it yet.

@bfloch bfloch dismissed their stale review November 8, 2019 19:23

I found a better fix.

@bfloch
Copy link
Contributor

bfloch commented Nov 8, 2019

Let's close this in favor of #794 and #795
I made it two PRs so that we can see if the general workflow would work.
I'll address a better fall back solution soon.

@nerdvegas nerdvegas added ON HOLD Awaiting other tasks, or kept for reference only topic:CI labels Nov 8, 2019
@nerdvegas
Copy link
Contributor Author

Fixed by #795

@nerdvegas nerdvegas closed this Nov 12, 2019
@bpabel bpabel deleted the issue_790-windows-ci-fail-on-forked-pr branch January 19, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ON HOLD Awaiting other tasks, or kept for reference only topic:CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

windows Actions workflow fails on PRs from fork
2 participants