Skip to content

Upgrade husky to v9#482

Merged
joshmgross merged 2 commits intoactions:mainfrom
benelan:main
Jul 29, 2024
Merged

Upgrade husky to v9#482
joshmgross merged 2 commits intoactions:mainfrom
benelan:main

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
Contributor

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
Contributor

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
@joshmgross
Copy link
Contributor

@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

2 participants