Skip to content

Commit 9ad75b5

Browse files
authored
Merge branch 'main' into 4geru/generate-rich-menu
2 parents e266dec + 6069e00 commit 9ad75b5

17 files changed

+327
-52
lines changed

.github/scripts/npm-audit.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
dirs=()
5+
while IFS= read -r path; do
6+
dirs+=("$(dirname "$path")")
7+
done < <(
8+
find . \( -path '*/node_modules' -o -path '*/dist' \) -prune -o \
9+
\( -name package.json -o -name package-lock.json \) -print
10+
)
11+
12+
IFS=$'\n' dirs=($(printf '%s\n' "${dirs[@]}" | sort -u)); unset IFS
13+
14+
declare -a failed=()
15+
16+
for dir in "${dirs[@]}"; do
17+
printf '\n\n\033[1;34m==> %s\033[0m\n' "$dir"
18+
19+
pushd "$dir" >/dev/null
20+
if ! npm audit --audit-level moderate; then
21+
failed+=("$dir")
22+
fi
23+
popd >/dev/null
24+
done
25+
26+
if ((${#failed[@]})); then
27+
echo -e "\n\033[0;31mnpm audit reported vulnerabilities in:\033[0m"
28+
printf ' - %s\n' "${failed[@]}"
29+
echo "You can run 'npm audit fix' in these directories to resolve the issues."
30+
echo "If running 'npm audit fix' does not resolve the issues, you may need to manually update dependencies."
31+
exit 1
32+
else
33+
echo "npm audit passed: no vulnerabilities detected"
34+
exit 0
35+
fi

.github/workflows/check-eol-newrelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
if: github.repository == 'line/line-bot-mcp-server'
1616
steps:
1717
- name: Check out code
18-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919

2020
- name: Run EoL & NewRelease check
21-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
21+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
2222
with:
2323
script: |
2424
const checkEolAndNewReleases = require('.github/scripts/check-eol-newrelease.cjs');

.github/workflows/close-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write
1515
if: github.repository == 'line/line-bot-mcp-server'
1616
steps:
17-
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
17+
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
1818
with:
1919
days-before-issue-stale: 28 # 4 weeks
2020
days-before-issue-close: 0

.github/workflows/create-draft-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
permissions:
4646
contents: write
4747
steps:
48-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4949
- name: Fetch Latest Release
5050
id: get-latest-release
51-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
51+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
5252
with:
5353
script: |
5454
const latestRelease = await github.rest.repos.getLatestRelease({
@@ -64,7 +64,7 @@ jobs:
6464
6565
- name: Calculate New Version
6666
id: calculate-version
67-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
67+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
6868
with:
6969
script: |
7070
const latestTag = '${{ steps.get-latest-release.outputs.latest_tag }}';
@@ -85,7 +85,7 @@ jobs:
8585
8686
- name: Generate Release Notes
8787
id: generate-release-notes
88-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
88+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
8989
with:
9090
script: |
9191
const { data: releaseNotes } = await github.rest.repos.generateReleaseNotes({

.github/workflows/label-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
issues: write
1515
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1717

1818
- name: Add label on issue open
1919
if: github.event.action == 'opened' || github.event.action == 'reopened'

.github/workflows/npm-audit.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Reminder for 'run npm audit'"
2+
3+
on:
4+
schedule:
5+
- cron: '0 22 * * *'
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- 'main'
10+
11+
jobs:
12+
run-npm-audit:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
issues: write
17+
if: github.repository == 'line/line-bot-mcp-server'
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
21+
with:
22+
node-version: '24'
23+
# Enable this when setup-node v5 is released
24+
# package-manager-cache: false
25+
26+
- name: Run npm audit and check diff
27+
id: audit
28+
run: .github/scripts/npm-audit.sh
29+
continue-on-error: true
30+
31+
- name: Create or update reminder issue
32+
if: steps.audit.outcome == 'failure'
33+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
34+
env:
35+
TZ: 'Asia/Tokyo'
36+
with:
37+
script: |
38+
const { owner, repo } = context.repo;
39+
const title = 'Reminder: run npm audit';
40+
const securityURL = `https://github.com/${owner}/${repo}/security`;
41+
const baseBody = [
42+
'Fix all vulnerabilities. You can check with `.github/scripts/npm-audit.sh` locally, then send a PR with the fixes.',
43+
`After fixing, make sure the vulnerabilities count in **${securityURL}** is **0**.`
44+
].join('\n\n');
45+
46+
const { data: result } = await github.rest.search.issuesAndPullRequests({
47+
q: `repo:${owner}/${repo} is:issue is:open in:title "${title}"`
48+
});
49+
50+
const today = new Date();
51+
52+
if (result.total_count === 0) {
53+
await github.rest.issues.create({
54+
owner,
55+
repo,
56+
title,
57+
body: `${baseBody}\n\n0 days have passed.`
58+
});
59+
} else {
60+
const issue = result.items[0];
61+
const created = new Date(issue.created_at);
62+
const diffDays = Math.floor((today - created) / 86_400_000);
63+
await github.rest.issues.update({
64+
owner,
65+
repo,
66+
issue_number: issue.number,
67+
body: `${baseBody}\n\n${diffDays} days have passed.`
68+
});
69+
}

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ jobs:
1616
id-token: write
1717
issues: write
1818
steps:
19-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020
# Setup .npmrc file to publish to GitHub Packages
21-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
21+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2222
with:
23-
node-version: 22
23+
node-version: 24
2424
registry-url: 'https://registry.npmjs.org'
25+
# Enable this when setup-node v5 is released, and release is broken
26+
# package-manager-cache: false
2527
- run: npm install
2628
- name: Update version in package.json, package-lock.json
2729
run: |
@@ -34,12 +36,10 @@ jobs:
3436
echo "VERSION=$VERSION" >> $GITHUB_ENV
3537
node .github/scripts/update-version.mjs $VERSION
3638
- run: npm run release
37-
env:
38-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3939

4040
- name: Create GitHub Issue on Failure
4141
if: failure()
42-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
42+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
4343
with:
4444
script: |
4545
const { owner, repo } = context.repo;

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ jobs:
2323
name: Node.js ${{ matrix.node }}
2424

2525
steps:
26-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
submodules: true
2929
- name: Setup Node.js
30-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
30+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3131
with:
3232
node-version: ${{ matrix.node }}
3333
cache: 'npm'
34+
# Enable this when setup-node v5 is released, and release is broken
35+
# package-manager-cache: false
3436
- name: Install Dependency
3537
run: npm ci
3638
- name: Build
@@ -45,7 +47,7 @@ jobs:
4547
permissions:
4648
contents: read
4749
steps:
48-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4951
- name: Run pinact
5052
uses: suzuki-shunsuke/pinact-action@49cbd6acd0dbab6a6be2585d1dbdaa43b4410133 # v1.0.0
5153
with:

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The project structure is as follows:
3030
To add a new Tool, you can create a new file under `src/tools/` and
3131
implement the Tool in that file. The Tool should extend `AbstractTool`
3232
and should be registered in `src/index.ts`.
33+
Please remember to add the description of the tool to both README.md and README.ja.md.
3334

3435
### Run all CI tasks in your local
3536

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.16-alpine AS builder
1+
FROM node:22.19-alpine AS builder
22

33
COPY . /app
44

0 commit comments

Comments
 (0)