-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
build(gha): Fix js lint job for forked repos #21893
Conversation
@@ -19,6 +19,8 @@ jobs: | |||
# because we want to lint + fix + commit, we need to checkout the HEAD sha (otherwise | |||
# it checks out the merge commit and we will not be able to commit to it) | |||
ref: ${{ github.event.pull_request.head.ref || 'master' }} | |||
# We need the repo here so that this works for forks | |||
repo: ${{ github.event.pull_request.head.repo.full_name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, don't we need pull_request_target
à la #21600 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't because there are no secrets (this doesn't include github_token since it will use the token from the forked repo) that are used, and no write access to getsentry/sentry
repo is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see it working here #21906
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshuarli Updated to have a specific task for forks as the action doesn't have access to write to the fork :/
@@ -85,8 +92,7 @@ jobs: | |||
git push origin | |||
|
|||
- name: tsc | |||
if: steps.changes.outputs.frontend == 'true' | |||
continue-on-error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what we want (it means if tsc fails, it moves on to next step without failing job).
This fixes the js lint job for forked repos, otherwise it would attempt to check out the forked branch from getsentry repo.
eddbd01
to
53158f3
Compare
This fixes the js lint job for forked repos, otherwise it would attempt to check out the forked branch from getsentry repo. We can't run the eslint + fix on forks, so create a new step for forks.