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

Run workflows only in the main repository not on forks #19351

Closed
1 task done
Angelk90 opened this issue Oct 17, 2024 · 6 comments · Fixed by #18861, #19789 or #20382
Closed
1 task done

Run workflows only in the main repository not on forks #19351

Angelk90 opened this issue Oct 17, 2024 · 6 comments · Fixed by #18861, #19789 or #20382
Assignees
Labels
bug [core label] open source Open source community projects, contributions, etc

Comments

@Angelk90
Copy link
Contributor

Check for existing issues

  • Completed

Describe the feature

I forked the latest version recently, but I noticed that the workflows are executed, since I receive that the workflows some are failed, wouldn't it be better not to execute the workflows if we are not in the main repository?

Here are the ones that have been started:

  • Bump collab-staging Tag
  • CI
  • Deploy Docs
  • Docs
  • Release Nightly
  • Update All Top Ranking Issues
  • Update Weekly Top Ranking Issues
name: Example Workflow

on:
  push:
    branches:
      - main

jobs:
  example-job:
    if: github.repository == 'zed-industries/zed'
    runs-on: ubuntu-latest
...

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@Angelk90 Angelk90 added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Oct 17, 2024
@notpeter notpeter self-assigned this Oct 17, 2024
@notpeter
Copy link
Member

I will fix this.

@notpeter
Copy link
Member

Looking at Angelk90/zed/actions it appears that most of the runs are being "Skipped" (which I believe is the best we can hope for).

E.g. Bump-Collab-Staging: https://github.com/Angelk90/zed/actions/runs/11389042655

And I think I've fixed the rest as part of:

Thanks for reporting.

notpeter added a commit that referenced this issue Oct 17, 2024
- Closes: #19351
- Switch to using the official [typos GitHub Action](https://github.com/crate-ci/typos/blob/master/docs/github-action.md)
- Move the typos check into `actions/check_style`
- Move Squawk Postgres migration check out of `actions/check_style` file into ci.yml
- `actions/check_style` can now be run on stateless/linux runners (previous required self-hosted MacOS runner)
- ci.yml: Split old `style` into checks into those that can run statelessly (linux) and everything else into a new `migration` group which benefit from the full git checkout available on the MacOS runners.
- ci.yml: Move `Check unused dependencies` from style to `linux_tests`
- Add `if: github.repository_owner == 'zed-industries'` to all jobs so they won't try and run on GitHub forks.
notpeter added a commit to zed-industries/extensions that referenced this issue Oct 17, 2024
@notpeter notpeter added bug [core label] open source Open source community projects, contributions, etc and removed enhancement [core label] triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 17, 2024
mikayla-maki pushed a commit that referenced this issue Oct 18, 2024
- Closes: #19351
- Switch to using the official [typos GitHub Action](https://github.com/crate-ci/typos/blob/master/docs/github-action.md)
- Move the typos check into `actions/check_style`
- Move Squawk Postgres migration check out of `actions/check_style` file into ci.yml
- `actions/check_style` can now be run on stateless/linux runners (previous required self-hosted MacOS runner)
- ci.yml: Split old `style` into checks into those that can run statelessly (linux) and everything else into a new `migration` group which benefit from the full git checkout available on the MacOS runners.
- ci.yml: Move `Check unused dependencies` from style to `linux_tests`
- Add `if: github.repository_owner == 'zed-industries'` to all jobs so they won't try and run on GitHub forks.
noaccOS pushed a commit to noaccOS/zed that referenced this issue Oct 19, 2024
- Closes: zed-industries#19351
- Switch to using the official [typos GitHub Action](https://github.com/crate-ci/typos/blob/master/docs/github-action.md)
- Move the typos check into `actions/check_style`
- Move Squawk Postgres migration check out of `actions/check_style` file into ci.yml
- `actions/check_style` can now be run on stateless/linux runners (previous required self-hosted MacOS runner)
- ci.yml: Split old `style` into checks into those that can run statelessly (linux) and everything else into a new `migration` group which benefit from the full git checkout available on the MacOS runners.
- ci.yml: Move `Check unused dependencies` from style to `linux_tests`
- Add `if: github.repository_owner == 'zed-industries'` to all jobs so they won't try and run on GitHub forks.
osiewicz pushed a commit that referenced this issue Oct 22, 2024
- Closes: #19351
- Switch to using the official [typos GitHub Action](https://github.com/crate-ci/typos/blob/master/docs/github-action.md)
- Move the typos check into `actions/check_style`
- Move Squawk Postgres migration check out of `actions/check_style` file into ci.yml
- `actions/check_style` can now be run on stateless/linux runners (previous required self-hosted MacOS runner)
- ci.yml: Split old `style` into checks into those that can run statelessly (linux) and everything else into a new `migration` group which benefit from the full git checkout available on the MacOS runners.
- ci.yml: Move `Check unused dependencies` from style to `linux_tests`
- Add `if: github.repository_owner == 'zed-industries'` to all jobs so they won't try and run on GitHub forks.
@Angelk90
Copy link
Contributor Author

@notpeter : The problem still persists with CI.
Screenshot 2024-10-24 alle 11 43 26

Screenshot 2024-10-24 alle 11 42 52

@notpeter
Copy link
Member

Thanks for reporting. Again.
Should be fixed on main.

@Angelk90
Copy link
Contributor Author

Angelk90 commented Nov 7, 2024

@notpeter : I don't understand why this action started on a fork.
Not having the tab issue.
Screenshot 2024-11-07 alle 11 10 31

@notpeter
Copy link
Member

notpeter commented Nov 7, 2024

Thanks for reporting. Again.
Should be fixed on main. Again.

Maybe we need a github actions workflow to check the github actions workflows so we don't accidentally run github actions workflows except where we want to run github actions workflows.

CharlesChen0823 pushed a commit to CharlesChen0823/zed that referenced this issue Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] open source Open source community projects, contributions, etc
Projects
None yet
2 participants