Skip to content

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

@jsoref

Description

@jsoref

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions