8000 chore: skip website tests on PRs from forks by kachick · Pull Request #7296 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

chore: skip website tests on PRs from forks #7296

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ jobs:
TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER: true

website_tests:
# The NETLIFY_TOKEN secret will not be available on forks
if: github.repository_owner == 'typescript-eslint'
# The NETLIFY_TOKEN secret will not be available on PRs from forks
if: (github.event_name == 'push' && github.ref_name == 'main') || (github.event.pull_request.head.repo.full_name == github.repository)
Comment on lines +228 to +229
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not block PRs in a fork to the same fork.
If we really need to skip all PRs in forks, this may be following

Suggested change
# The NETLIFY_TOKEN secret will not be available on PRs from forks
if: (github.event_name == 'push' && github.ref_name == 'main') || (github.event.pull_request.head.repo.full_name == github.repository)
# The NETLIFY_TOKEN secret will not be available on forks
if: (github.event_name == 'push' && github.ref_name == 'main') || (github.event.pull_request.head.repo.full_name == 'typescript-eslint/typescript-eslint')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question, merge_group should trigger this test? Then it may be following

Suggested change
if: (github.event_name == 'push' && github.ref_name == 'main') || (github.event.pull_request.head.repo.full_name == github.repository)
if: contains(fromJSON('["push", "merge_group"]'), github.event_name) || (github.event.pull_request.head.repo.full_name == github.repository)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: https://github.blog/changelog/2022-08-18-merge-group-webhook-event-and-github-actions-workflow-trigger

We don't use merge queues. I don't think test triggers need to account for them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing the direction! I just had confused with the trigger in here 🙇‍♂️

permissions:
contents: read # to fetch code (actions/checkout)

Expand Down
0