kitkat729 / lru-cache

Least Recently Used cache
MIT License
0 stars 0 forks source link

NPM publish workflow not firing #34

Open kitkat729 opened 2 years ago

kitkat729 commented 2 years ago

The reason why the npm publish workflow not firing is because the on release created event never fired. Normally, when you create a release on github, github would fire the all the workflow listening to the event. However, the event chain stops at Release Please. Currently Release Please uses the default GITHUB_TOKEN to run the workflow. Using GITHUB_TOKEN would cause workflow not registering new events, such as the release created event.

https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow

There are 2 options: 1) Integrate NPM publish into Release Please https://github.com/google-github-actions/release-please-action#release-types-supported

2) Change the authentication token type to Personal Access Token https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow

A/C NPM publish should publish new version to the registry when a new release is created

kitkat729 commented 2 years ago

Thoughts about option 1: Integrating publish into release please would not require the release created event to fire because publishing would have been part of the release process. Once the release PR is merged, a new release gets created and new version gets published. To postpone the release, just don't merge the PR. No new token is needed. The only trade off is less modularization.

Thoughts about option 2: Suppose changing the token works. That means the developer will need to setup a PAT to make publish work.