Error: Input required and not supplied: apiToken
This is the github actions workflow I'm using to deploy my react (vite) app to cf pages. It's working fine except for PRs from forks of the repo where it is giving the error (screenshot attached).
10 Replies
In the screenshot it isn't there
My guess, the api token is not actually set. Check your secrets and re-set it
its working for main branch push and PRs opened from branch created on the repo.
its only not working for PRs from forked repos.
ah except for forks
yeah github doesn't let forks see secrets
With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.
😐
any fix ?
because I need preview deployments from forked repo PRs.
no, you don't really want them to have access
they could literally just pr a modification to the workflow with "echo $CF_API_TOKEN" and have API access to your account
https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions
ya right
but I need the preview deployment
so is it possibe to do so without revealing the secrect ?
No that isn't how GitHub actions works
You could try a different CI platform
ok if I use git integration of CF for deployment ?