Skip to content

Commit 2ea68bb

Browse files
authored
ref: use ts scripts (#8)
convert to typescript
1 parent 2fcdec0 commit 2ea68bb

8 files changed

Lines changed: 2109 additions & 47 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# local build for automation repo scripts
2+
name: build
3+
4+
on:
5+
push:
6+
branches: [main]
7+
paths: ["src/**", "package.json"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Generate a token
14+
id: bot-token
15+
uses: actions/create-github-app-token@v1
16+
with:
17+
app-id: ${{ secrets.BOT_APP_ID }}
18+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
19+
20+
- uses: actions/checkout@v4
21+
with:
22+
token: ${{ steps.bot-token.outputs.token }}
23+
24+
- name: Setup PNPM
25+
uses: pnpm/action-setup@v4
26+
27+
- name: Setup Node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 22
31+
cache: pnpm
32+
33+
- name: Install dependencies
34+
run: pnpm install
35+
36+
- name: Build
37+
run: pnpm run build
38+
39+
- name: Commit dist
40+
uses: stefanzweifel/git-auto-commit-action@v5
41+
env:
42+
GH_TOKEN: ${{ steps.bot-token.outputs.token }}
43+
with:
44+
commit_message: "[ci] build"
45+
file_pattern: "dist/*"
46+
commit_user_name: bombshell-bot

.github/workflows/mergebot.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
uses: actions/setup-node@v4
5656
with:
5757
node-version: 22
58-
registry-url: https://registry.npmjs.org/
59-
cache: "pnpm"
6058

6159
- id: message
6260
name: Format Discord message
@@ -67,10 +65,10 @@ jobs:
6765
COMMIT_ID: ${{ github.event.commits[0].id }}
6866
EMOJIS: ${{ inputs.EMOJIS }}
6967
COAUTHOR_TEMPLATES: ${{ inputs.COAUTHOR_TEMPLATES }}
70-
run: node automation/scripts/mergebot.js
68+
run: node automation/dist/mergebot.mjs
7169

7270
- name: Send message on Discord
7371
env:
7472
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
7573
DISCORD_MESSAGE: "${{ steps.message.outputs.DISCORD_MESSAGE }}"
76-
run: node automation/scripts/discord.js
74+
run: node automation/dist/discord.mjs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
dist

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
{
2-
"type": "module"
2+
"name": "@bomb.sh/automation",
3+
"private": true,
4+
"type": "module",
5+
"exports": {
6+
"./*": "./dist/*.mjs"
7+
},
8+
"scripts": {
9+
"build": "bsh build --bundle"
10+
},
11+
"devDependencies": {
12+
"@bomb.sh/tools": "^0.2.1",
13+
"@types/node": "^22.19.15"
14+
}
315
}

0 commit comments

Comments
 (0)