fix: show integers for values below 1k in trends chart tooltip #227
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claim Contributor Message | |
| on: | |
| pull_request_target: | |
| types: | |
| - closed | |
| permissions: {} | |
| jobs: | |
| welcome: | |
| permissions: | |
| pull-requests: write # to comment on PRs | |
| if: github.repository == 'npmx-dev/npmx.dev' && github.event.pull_request.merged == true | |
| runs-on: ubuntu-slim | |
| name: π Welcome new contributor | |
| steps: | |
| - name: π Welcome new contributor | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const author = pr.user.login; | |
| // Check if this is the author's first merged PR | |
| const { data: prs } = await github.rest.search.issuesAndPullRequests({ | |
| q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:merged author:${author}`, | |
| }); | |
| // If the only merged PR is this one, it's their first contribution | |
| if (prs.total_count !== 1) { | |
| console.log(`@${author} already has ${prs.total_count} merged PRs β skipping welcome comment.`); | |
| return; | |
| } | |
| const emojis = ['π', 'π₯³', 'π', 'π', 'β', 'π«', 'β¨', 'πͺ', 'π', 'π', 'π€©', 'π₯']; | |
| const emoji = emojis[Math.floor(Math.random() * emojis.length)]; | |
| const body = [ | |
| `Thanks for your first contribution, @${author}! ${emoji}`, | |
| '', | |
| `We'd love to welcome you to the npmx community. Come and say hi on [Discord](https://build.npmx.dev)! And once you've joined, visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim the **contributor** role.`, | |
| ].join('\n'); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| body, | |
| }); | |
| console.log(`Welcomed new contributor @${author} on PR #${pr.number}`); |