Skip to content

Commit dcf2c80

Browse files
authored
ci: enable autofix.ci and pkg-pr-new workflows (#734)
1 parent 3247172 commit dcf2c80

File tree

6 files changed

+98
-8
lines changed

6 files changed

+98
-8
lines changed

.changeset/wise-houses-build.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-prettier": patch
3+
---
4+
5+
ci: enable `NPM_CONFIG_PROVENANCE` env

.github/workflows/autofix.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
autofix:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
23+
24+
- name: Setup Node.js LTS
25+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
26+
with:
27+
node-version: lts/*
28+
cache: pnpm
29+
30+
- name: Install Dependencies
31+
run: pnpm install --prefer-frozen-lockfile
32+
33+
- name: Format Codes
34+
run: pnpm format
35+
36+
- name: Apply autofix.ci
37+
uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1
38+
with:
39+
fail-fast: false

.github/workflows/ci.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ jobs:
3131
eslint: 8
3232

3333
steps:
34-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
34+
- name: Checkout Repo
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3536

36-
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
3739

38-
- name: Use Node.js ${{ matrix.node }}
40+
- name: Setup Node.js ${{ matrix.node }}
3941
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4042
with:
4143
node-version: ${{ matrix.node }}

.github/workflows/pkg-pr-new.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Any Commit
2+
on:
3+
- push
4+
- pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
20+
21+
- name: Setup Node.js LTS
22+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
23+
with:
24+
node-version: lts/*
25+
cache: pnpm
26+
27+
- name: Install Dependencies
28+
run: pnpm install --prefer-frozen-lockfile
29+
30+
- name: Publish
31+
run: pnpm dlx pkg-pr-new publish --compact

.github/workflows/release.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write
14+
id-token: write
15+
pull-requests: write
16+
817
jobs:
918
release:
1019
name: Release
1120
runs-on: ubuntu-latest
1221
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
22+
- name: Checkout Repo
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1424

15-
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
1627

17-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28+
- name: Setup Node.js LTS
29+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1830
with:
1931
node-version: lts/*
2032
cache: pnpm
@@ -31,4 +43,5 @@ jobs:
3143
title: 'chore: release eslint-plugin-prettier'
3244
env:
3345
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_CONFIG_PROVENANCE: true
3447
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"repository": "https://github.com/prettier/eslint-plugin-prettier.git",
66
"homepage": "https://github.com/prettier/eslint-plugin-prettier#readme",
77
"author": "Teddy Katz",
8-
"contributors": [
9-
"JounQin (https://github.com/JounQin) <[email protected]>"
8+
"maintainers": [
9+
"JounQin <[email protected]> (https://github.com/JounQin)"
1010
],
1111
"funding": "https://opencollective.com/eslint-plugin-prettier",
1212
"license": "MIT",

0 commit comments

Comments
 (0)