Skip to content

Commit ba5e00d

Browse files
authored
chore: repository maintenance (#240)
* chore: repository maintenance * fix * chore: update renovate configuration for automerging * Create calm-pears-impress.md * update
1 parent f323827 commit ba5e00d

File tree

13 files changed

+301
-33
lines changed

13 files changed

+301
-33
lines changed

.changeset/calm-pears-impress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"toml-eslint-parser": patch
3+
---
4+
5+
use npm trusted publishing

.github/FUNDING.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
# These are supported funding model platforms
22

33
github: ota-meshi
4-
patreon: null # Replace with a single Patreon username
5-
open_collective: null # Replace with a single Open Collective username
6-
ko_fi: null # Replace with a single Ko-fi username
7-
tidelift: null # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: null # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: null # Replace with a single Liberapay username
10-
issuehunt: null # Replace with a single IssueHunt username
11-
otechie: null # Replace with a single Otechie username
12-
custom: null # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/GHPages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: GHPages
22

33
on:
4+
workflow_dispatch: null
45
push:
56
branches: [main]
6-
workflow_dispatch: null
77

88
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
99
permissions:
@@ -13,7 +13,7 @@ permissions:
1313

1414
# Allow one concurrent deployment
1515
concurrency:
16-
group: pages
16+
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:
@@ -24,8 +24,8 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
28-
- uses: actions/setup-node@v4
27+
uses: actions/checkout@v6
28+
- uses: actions/setup-node@v6
2929
- name: Install And Build
3030
run: |+
3131
npm install
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Pages
3737
uses: actions/configure-pages@v5
3838
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v3
39+
uses: actions/upload-pages-artifact@v4
4040
with:
4141
path: ./explorer/dist
4242
- name: Deploy to GitHub Pages

.github/workflows/NodeCI.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,36 @@ on:
66
pull_request:
77
branches: [main]
88

9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
lint:
1116
runs-on: ubuntu-latest
1217
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@v6
19+
- uses: actions/setup-node@v6
20+
- uses: actions/cache@v4
21+
with:
22+
path: node_modules
23+
key: ${{ runner.os }}-${{ hashFiles('package.json') }}-${{ github.ref }}
1524
- name: Install Packages
1625
run: npm install -f
1726
- name: Lint
1827
run: npm run lint
28+
- name: Build
29+
run: npm run build
1930
test:
2031
runs-on: ubuntu-latest
2132
strategy:
2233
matrix:
23-
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
34+
node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x]
2435
steps:
25-
- uses: actions/checkout@v4
36+
- uses: actions/checkout@v6
2637
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
38+
uses: actions/setup-node@v6
2839
with:
2940
node-version: ${{ matrix.node-version }}
3041
- name: Setup

.github/workflows/Release.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,49 @@ name: Release
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77

8-
permissions:
9-
contents: write
10-
issues: write
11-
pull-requests: write
8+
permissions: {}
9+
10+
# Allow one concurrent deployment
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1214

1315
jobs:
1416
release:
17+
# prevents this action from running on forks
18+
if: github.repository == 'ota-meshi/toml-eslint-parser'
19+
permissions:
20+
contents: write # to create release (changesets/action)
21+
id-token: write # OpenID Connect token needed for provenance
22+
pull-requests: write # to create pull request (changesets/action)
1523
name: Release
1624
runs-on: ubuntu-latest
1725
steps:
1826
- name: Checkout Repo
19-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2028
with:
2129
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2230
fetch-depth: 0
23-
2431
- name: Setup Node.js
25-
uses: actions/setup-node@v4
26-
32+
uses: actions/setup-node@v6
33+
with:
34+
node-version: lts/*
2735
- name: Install Dependencies
28-
run: npm install --legacy-peer-deps
36+
run: npm install
37+
- name: Build
38+
run: npm run build
2939

3040
- name: Create Release Pull Request or Publish to npm
3141
id: changesets
3242
uses: changesets/action@v1
3343
with:
3444
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
35-
version: yarn version:ci
45+
version: npm run version:ci
3646
# This expects you to have a script called release which does a build for your packages and calls changeset publish
3747
publish: npm run release
3848
commit: "chore: release toml-eslint-parser"
3949
title: "chore: release toml-eslint-parser"
4050
env:
4151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/format.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,27 @@ name: 👔 Format
33
on:
44
workflow_dispatch: null
55

6+
permissions:
7+
contents: write
8+
9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
614
jobs:
715
format:
816
runs-on: ubuntu-latest
917

1018
steps:
1119
- name: Checkout repo
12-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1321
- name: Setup node
14-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
1523
- name: Install deps
1624
run: npm install
25+
- name: Build
26+
run: npm run build
1727
- name: Format
1828
run: npm run eslint-fix
1929
- name: Commit
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update pkg.pr.new comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Publish to pkg.pr.new]
6+
types:
7+
- completed
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
# Allow one concurrent deployment
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
if: github.repository == 'ota-meshi/toml-eslint-parser'
21+
name: Update comment
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Download artifact
26+
uses: actions/download-artifact@v6
27+
with:
28+
name: output
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
run-id: ${{ github.event.workflow_run.id }}
31+
- run: ls -R .
32+
- name: Post or update comment
33+
uses: actions/github-script@v8
34+
with:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
script: |
37+
const fs = require('fs');
38+
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
39+
const { default: process } = await import('${{ github.workspace }}/tools/pkg.pr.new-comment.mjs')
40+
41+
await process({github, context, core, output})

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to pkg.pr.new
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
tags: ["!**"]
8+
9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
if: github.repository == 'ota-meshi/toml-eslint-parser'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
- uses: actions/setup-node@v6
22+
- name: Install Packages
23+
run: npm install
24+
- name: Build
25+
run: npm run build
26+
- run: npx pkg-pr-new publish --compact '.' --json output.json --comment=off
27+
- name: Add metadata to output
28+
uses: actions/github-script@v8
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
const fs = require('fs');
33+
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
34+
output.number = context.issue.number;
35+
output.event_name = context.eventName;
36+
output.ref = context.ref;
37+
output.sha = context.eventName === 'pull_request'
38+
? context.payload.pull_request.head.sha
39+
: context.payload.after;
40+
fs.writeFileSync('output.json', JSON.stringify(output), 'utf8');
41+
- name: Upload output
42+
uses: actions/upload-artifact@v5
43+
with:
44+
name: output
45+
path: ./output.json
46+
47+
- run: ls -R .

.github/workflows/stale.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Close stale issues and PRs
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
6+
permissions:
7+
issues: write
8+
pull-requests: write
9+
10+
jobs:
11+
stale:
12+
if: github.repository == 'ota-meshi/toml-eslint-parser'
13+
name: Close stale issues with missing information
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v10
17+
with:
18+
any-of-labels: "needs repro,needs info,needs more info"
19+
days-before-stale: 60
20+
days-before-close: 14
21+
stale-issue-message: This issue is is stale because it missing information and has been open for 60 days with no activity.
22+
stale-pr-message: This PR is is stale because it missing information and has been open for 60 days with no activity.
23+
close-issue-message: >
24+
This issue has been automatically closed because we haven't received a
25+
response from the original author 🙈. This automation helps keep the issue
26+
tracker clean from issues that aren't actionable. Please reach out if you
27+
have more information for us! 🙂
28+
close-pr-message: >
29+
This PR has been automatically closed because we haven't received a
30+
response from the original author 🙈. This automation helps keep the issue
31+
tracker clean from PRs that aren't actionable. Please reach out if you
32+
have more information for us! 🙂

renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
23
"extends": [
34
"config:base",
45
":preserveSemverRanges",
@@ -12,6 +13,10 @@
1213
{
1314
"depTypeList": ["devDependencies"],
1415
"automerge": true
16+
},
17+
{
18+
"matchManagers": ["github-actions", "devcontainer"],
19+
"automerge": true
1520
}
1621
]
1722
}

0 commit comments

Comments
 (0)