Skip to content

Commit

Permalink
feat: Npm cache comments for issue bot (#14669)
Browse files Browse the repository at this point in the history
* npm cache

* review

* Update .github/workflows/issue-triage.yml

Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>

* Apply suggestions from code review

Co-authored-by: Brian Ng <bng412@gmail.com>

* Update .github/workflows/issue-triage.yml

* Apply suggestions from code review

Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
  • Loading branch information
3 people committed Jun 20, 2022
1 parent 8a83fc1 commit 4a2101c
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
issue: ${{ github.event.issue.number }}
comment: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to report an issue. The
collaborators on this project attempt to help as many people as
possible, but we're a limited number of volunteers, so it's
We really appreciate you taking the time to report an issue. The
collaborators on this project attempt to help as many people as
possible, but we're a limited number of volunteers, so it's
possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a
vibrant [Slack community](https://babeljs.slack.com) that typically always has someone
If you need any help, or just have general Babel or JavaScript questions, we have a
vibrant [Slack community](https://babeljs.slack.com) that typically always has someone
willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite.
needs_info:
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
Please make sure you have the following information documented in
this ticket:
1. Your Babel configuration (typically from `.babelrc` or `babel.config.js`)
2. The current (incorrect) behavior you're seeing
Expand All @@ -81,4 +81,33 @@ jobs:
[`repl`](https://babeljs.io/repl/), or if the `repl` is
insufficient, a new and minimal repository with instructions on
how to build/replicate the issue.
npm_cache:
name: Npm Cache
runs-on: ubuntu-latest
steps:
- name: Npm Cache Comment
uses: babel/actions/create-comment@v2
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'i: npm cache'
with:
token: ${{ secrets.BOT_TOKEN }}
issue: ${{ github.event.issue.number }}
comment: >
Hi @${{ github.event.issue.user.login }}!
This seems to be an issue caused by a package that you are not able to download.
You can verify that the package is available using the npm website:
for example, https://www.npmjs.com/package/@babel/types?activeTab=versions is the URL for `@babel/types`
(replace `@babel/types` in the URL with the package you want to check). If you see zero downloads don't worry:
npm can take up to a few days to display the downloads count, but this does not mean that the package is not available.
Here are some things you can try:
1. Please check if there is a stale proxy or cache between you and npm
(this is the most likely cause and it is common in corporate networks).
2. Visit https://status.npmjs.org/ to see if the current npm is working properly.
3. See https://gist.github.com/hzoo/df94af2d2ec48696e683b772c775aa67

0 comments on commit 4a2101c

Please sign in to comment.