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

Upgrade husky to v9 #482

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Upgrade husky to v9 #482

merged 2 commits into from
Jul 29, 2024

Conversation

benelan
Copy link
Contributor

@benelan benelan commented Jul 25, 2024

Migrate to husky v9 following the instructions in their release notes.

For context, I got the following husky error when installing this package for JSDoc support:

❱ npm i -D @types/github-script@github:actions/github-script
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command npm install --force --cache=/home/****/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > github-script@7.0.1 prepare
npm ERR! > husky install
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! .git can't be found (see https://git.io/Jc3F9)
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /home/*****/.npm/_cacache/tmp/git-cloneXXXXXXDFwwTa
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c husky install
npm ERR!

I found a husky issue where people said the problem is fixed in newer versions: typicode/husky#851

@benelan benelan requested a review from a team as a code owner July 25, 2024 03:59
@benelan
Copy link
Contributor Author

benelan commented Jul 25, 2024

I just confirmed this PR resolves my error by installing via:

npm i -D @types/github-script@github:actions/github-script#pull/482

I use git worktrees, and it sounds using a non-standard location for GIT_DIR would break old versions of husky. The relevant line husky's release notes seems to be:

Modified behavior when .git is missing; it now triggers a warning instead of failure.

benelan added a commit to Esri/calcite-design-system that referenced this pull request Jul 25, 2024
## Summary

- Add
[`actions/github-script`](https://github.com/marketplace/actions/github-script)
types
- Add
[`@octokit/webhook-types`](https://www.npmjs.com/package/@octokit/webhooks-types)
for improved payload typing
- Use JSDoc wizardry to typecheck the JavaScript files used by our
workflows

## Notes

I got a husky error when installing the `github-script` types. Here is a
related issue: typicode/husky#851

Upgrading husky resolves the error, so I created a pull request:
actions/github-script#482

I installed `github-script` using the PR number for now. We can unpin
the PR once it's merged by re-installing via the [command in the
doc](https://github.com/actions/github-script/#use-scripts-with-jsdoc-support):

```sh
npm i -D @types/github-script@github:actions/github-script
```
@benelan
Copy link
Contributor Author

benelan commented Jul 25, 2024

Thanks for the review! It's my first time contributing so I believe you need to manually run the PR check. Feel free to merge once the check passes since I don't have write permissions. Appreciate it!

@joshmgross
Copy link
Member

Yep, ran into a couple internal issues with a feature we had enabled for this repository

https://github.com/actions/github-script/actions/runs/10087909477

I can push an empty commit to re-trigger CI

@joshmgross
Copy link
Member

Ah looks like I don't have permissions to do that, do you mind pushing an empty commit to your branch?

@benelan
Copy link
Contributor Author

benelan commented Jul 27, 2024

I pushed an empty commit, let me know if you need anything else from my end! I have the "Allow edits by maintainers" box checked so I'm not sure why it didn't let you do it.

@benelan benelan temporarily deployed to debug-integration-test July 29, 2024 19:54 — with GitHub Actions Inactive
@joshmgross joshmgross merged commit 35b1cdd into actions:main Jul 29, 2024
14 checks passed
@joshmgross
Copy link
Member

@benelan do you need a new release of the action to get unblocked or are you good with these changes just being in main for now?

@benelan
Copy link
Contributor Author

benelan commented Jul 29, 2024

The changes being on main unblocks the issue on my end. I can pin a release tag later but it's not a priority for me, thanks for asking!

calcite-admin pushed a commit to Esri/calcite-design-system that referenced this pull request Jul 30, 2024
## Summary

- Add
[`actions/github-script`](https://github.com/marketplace/actions/github-script)
types
- Add
[`@octokit/webhook-types`](https://www.npmjs.com/package/@octokit/webhooks-types)
for improved payload typing
- Use JSDoc wizardry to typecheck the JavaScript files used by our
workflows

## Notes

I got a husky error when installing the `github-script` types. Here is a
related issue: typicode/husky#851

Upgrading husky resolves the error, so I created a pull request:
actions/github-script#482

I installed `github-script` using the PR number for now. We can unpin
the PR once it's merged by re-installing via the [command in the
doc](https://github.com/actions/github-script/#use-scripts-with-jsdoc-support):

```sh
npm i -D @types/github-script@github:actions/github-script
```
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

Successfully merging this pull request may close these issues.

2 participants