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

Skip running preview-website workflow in forks with credentials #1617

Open
jsoref opened this issue Jun 21, 2022 · 0 comments
Open

Skip running preview-website workflow in forks with credentials #1617

jsoref opened this issue Jun 21, 2022 · 0 comments

Comments

@jsoref
Copy link
Contributor

jsoref commented Jun 21, 2022

The https://github.com/voyagermesh/voyager/blob/master/.github/workflows/preview-website.yml workflow absolutely requires credentials that forks will not have:

- name: Clone website repository
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
WEBSITE_REPOSITORY: ${{ secrets.WEBSITE_REPOSITORY }}
run: |
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${WEBSITE_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
git clone $url

If you're interested in letting it run in forks, then the first step should check for the presence of the required secrets, and if the they're missing, stop. This can be done with a step that sets an output, either setting an output for a job and then having the core job need that job and condition itself on the output, or by having each subsequent step if to the output.

I can provide a PR to implement either of the above.

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

1 participant