Skip to content

Commit 4b15668

Browse files
committed
ci(workflows): added permission to write to pull requests
1 parent 67e6213 commit 4b15668

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Deploy
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main
@@ -17,18 +18,13 @@ jobs:
1718
version: latest
1819
run_install: true
1920

20-
- name: Lint code
21-
run: |
22-
pnpm run lint:eslint
23-
2421
- name: Build
25-
run: pnpm run build
22+
run: pnpm run tsc
2623

2724
- name: Assets
2825
run: |
2926
cp package.json dist/package.json
3027
cp README.md dist/README.md
31-
cp LICENSE dist/LICENSE
3228
3329
- name: Config
3430
env:

.github/workflows/pull_request-opened.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Pull request opened
2-
32
on:
43
pull_request:
54
types:
@@ -10,6 +9,8 @@ on:
109
jobs:
1110
notify-greet:
1211
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
1314
steps:
1415
- name: Auto assign
1516
uses: actions/github-script@v7
@@ -38,7 +39,7 @@ jobs:
3839
3940
### 📖 Contribution Guidelines
4041
41-
For more details on how to contribute effectively, please refer to our [How to Contribute](https://github.com/simonkovtyk/esbuild-plugin-package-json/blob/main/docs/guides/HOW_TO_CONTRIBUTE.md) document.`
42+
For more details on how to contribute effectively, please refer to our [How to Contribute](https://github.com/simonkovtyk/esbuild-plugin-cleanup/blob/main/docs/guides/HOW_TO_CONTRIBUTE.md) document.`
4243
4344
github.rest.issues.createComment({
4445
owner: context.repo.owner,

.github/workflows/pull_request.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Pull request checks
2-
32
on:
43
pull_request:
54
types:
@@ -15,27 +14,35 @@ jobs:
1514
steps:
1615
- name: Checkout
1716
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1819

19-
- name: Install
20+
- name: NodeJS install
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: "lts/*"
24+
25+
- name: pnpm install
2026
uses: pnpm/action-setup@v4
2127
with:
2228
version: latest
2329
run_install: true
2430

2531
- name: Lint code
2632
run: |
27-
pnpm run lint:tsc
28-
pnpm run lint:eslint
33+
pnpm run tsc --noEmit
34+
pnpm run eslint .
2935
3036
- name: Lint commits
3137
if: github.event_name == 'pull_request'
3238
run: |
33-
commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
39+
pnpm run commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
3440
3541
notify_success:
3642
runs-on: ubuntu-latest
3743
needs: style_check
38-
44+
permissions:
45+
pull-requests: write
3946
if: success()
4047
steps:
4148
- name: Comment success
@@ -66,6 +73,8 @@ jobs:
6673
notify_failure:
6774
runs-on: ubuntu-latest
6875
needs: style_check
76+
permissions:
77+
pull-requests: write
6978
if: failure()
7079
steps:
7180
- name: Comment failure

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run lint:commit ${1}
1+
npm run commitlint -- --edit $1

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
npm run lint:tsc
2-
npm run lint:eslint
1+
npm run tsc -- --noEmit
2+
npm run eslint -- .

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"package config plugin"
2626
],
2727
"license": "MIT",
28-
"version": "2.0.0-next.0",
28+
"version": "2.0.0-next.1",
2929
"bugs": "https://github.com/simonkovtyk/esbuild-plugin-package-json/issues",
3030
"homepage": "https://github.com/simonkovtyk/esbuild-plugin-package-json",
3131
"repository": {
@@ -53,10 +53,9 @@
5353
"esbuild": ">=0.20.0"
5454
},
5555
"scripts": {
56-
"lint:commit": "commitlint --edit",
57-
"lint:eslint": "eslint .",
58-
"lint:tsc": "tsc --noEmit",
59-
"build": "tsc"
56+
"commitlint": "commitlint",
57+
"eslint": "eslint",
58+
"tsc": "tsc"
6059
},
6160
"devDependencies": {
6261
"@eslint/js": "^9.10.0",

0 commit comments

Comments
 (0)