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

Fix GitHub Actions workflow for forked repositories #22

Closed
printfer opened this issue Mar 14, 2023 · 1 comment
Closed

Fix GitHub Actions workflow for forked repositories #22

printfer opened this issue Mar 14, 2023 · 1 comment

Comments

@printfer
Copy link
Contributor

Currently, the GitHub Actions workflow does not run correctly on forked repositories. This is a minor issue, but it would be great to fix it alongside #21.

The chromatic.yml workflow fails due to the lack of a secret token. To fix this issue, we need to check if the secret token exists before executing the workflow. Here's an example:

  env:
    HAS_CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
  steps:
    - if: ${{ env.HAS_CHROMATIC_PROJECT_TOKEN }}
    ...

You can find more details on how other people have resolved this issue at github/docs#6861.

For the release-please.yml workflow, I suspect that the default setting prevents it from running on forked repositories, but I'm not entirely sure. To prevent the workflow from running in a forked repository, we can add a check like this:

if: "! github.event.pull_request.head.repo.fork " 

You can find more details about this issue at https://github.com/orgs/community/discussions/25217#discussioncomment-3246904.

By implementing these fixes, we can ensure that the GitHub Actions workflow runs correctly on forked repositories. This will improve the overall usability and accessibility of our repository.

@edjonesdev
Copy link
Owner

Fixed with #24

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

2 participants