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 pre-push hook to fail if working tree dirty #5194

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Jan 23, 2025

Explanation

Now that we've instructed the lint pipeline to update the ESLint warning thresholds file, if you introduce changes to lint violations prior to pushing, and you have the pre-push Git hook installed, you could forget to push changes to this file.

This commit extracts the "working tree dirty" check that we perform in the lint-build-test GitHub workflow to a script so that we can not only call it in the workflow but also after running yarn lint in the pre-push hook.

Note that you'll need to re-run yarn simple-git-hooks for this change to take effect.

References

Changelog

(N/A, developer-only change)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Now that we've instructed the lint pipeline to update the ESLint warning
thresholds file, if you introduce changes to lint violations prior to
pushing, and you have the `pre-push` Git hook installed, you could
forget to push changes to this file.

This commit extracts the "working tree dirty" check that we perform in
the `lint-build-test` GitHub workflow to a script so that we can not
only call it in the workflow but also after running `yarn lint` in the
`pre-push` hook.

Note that you'll need to re-run `yarn simple-git-hooks` for this change
to take effect.
@mcmire mcmire force-pushed the fail-on-changes-when-pushing branch from 155285b to 6fc3311 Compare January 23, 2025 23:37
@mcmire mcmire marked this pull request as ready for review January 24, 2025 00:05
@mcmire mcmire requested a review from a team as a code owner January 24, 2025 00:05
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@mcmire

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant