Skip to content

Commit e8d158c

Browse files
autofixes from Etherpad checkPlugin.js
1 parent d29c3ef commit e8d158c

6 files changed

Lines changed: 138 additions & 74 deletions

File tree

.github/workflows/backend-tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
version: 1.0
2323
-
2424
name: Install etherpad core
25-
uses: actions/checkout@v6
25+
uses: actions/checkout@v4
2626
with:
2727
repository: ether/etherpad-lite
2828
path: etherpad-lite
29-
- uses: pnpm/action-setup@v5
29+
- uses: pnpm/action-setup@v3
3030
name: Install pnpm
3131
with:
3232
version: 10
@@ -35,7 +35,7 @@ jobs:
3535
shell: bash
3636
run: |
3737
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38-
- uses: actions/cache@v5
38+
- uses: actions/cache@v4
3939
name: Setup pnpm cache
4040
with:
4141
path: ${{ env.STORE_PATH }}
@@ -44,7 +44,7 @@ jobs:
4444
${{ runner.os }}-pnpm-store-
4545
-
4646
name: Checkout plugin repository
47-
uses: actions/checkout@v6
47+
uses: actions/checkout@v4
4848
with:
4949
path: plugin
5050
- name: Remove tests
@@ -62,6 +62,7 @@ jobs:
6262
name: Run the backend tests
6363
working-directory: ./etherpad-lite/src
6464
run: |
65+
shopt -s globstar
6566
res=$(find ./plugin_packages -path "*/static/tests/backend/specs/*" 2>/dev/null | wc -l)
6667
if [ $res -eq 0 ]; then
6768
echo "No backend tests found"

.github/workflows/frontend-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
-
1414
name: Check out Etherpad core
15-
uses: actions/checkout@v6
15+
uses: actions/checkout@v4
1616
with:
1717
repository: ether/etherpad-lite
18-
- uses: pnpm/action-setup@v5
18+
- uses: pnpm/action-setup@v3
1919
name: Install pnpm
2020
with:
2121
version: 10
@@ -24,7 +24,7 @@ jobs:
2424
shell: bash
2525
run: |
2626
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27-
- uses: actions/cache@v5
27+
- uses: actions/cache@v4
2828
name: Setup pnpm cache
2929
with:
3030
path: ${{ env.STORE_PATH }}
@@ -33,7 +33,7 @@ jobs:
3333
${{ runner.os }}-pnpm-store-
3434
-
3535
name: Check out the plugin
36-
uses: actions/checkout@v6
36+
uses: actions/checkout@v4
3737
with:
3838
path: ./node_modules/__tmp
3939
-

.github/workflows/npmpublish.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# This workflow will run tests using node and then publish a package to the npm registry when a release is created
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
#
4+
# Publishing uses npm Trusted Publishing (OIDC) — no NPM_TOKEN secret is
5+
# required. Each package must have a trusted publisher configured on npmjs.com
6+
# pointing at this workflow file. See:
7+
# https://docs.npmjs.com/trusted-publishers
38

49
name: Node.js Package
510

@@ -9,11 +14,19 @@ on:
914
jobs:
1015
publish-npm:
1116
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # for `git push --follow-tags` of the version bump
19+
id-token: write # for npm OIDC trusted publishing
1220
steps:
1321
- uses: actions/setup-node@v6
1422
with:
23+
# OIDC trusted publishing needs npm >= 11.5.1, which requires
24+
# Node >= 20.17.0. setup-node's `20` resolves to the latest
25+
# 20.x, which satisfies that.
1526
node-version: 20
1627
registry-url: https://registry.npmjs.org/
28+
- name: Upgrade npm to >=11.5.1 (required for trusted publishing)
29+
run: npm install -g npm@latest
1730
- name: Check out Etherpad core
1831
uses: actions/checkout@v6
1932
with:
@@ -63,12 +76,10 @@ jobs:
6376
# already-used version number. By running `npm publish` after `git push`,
6477
# back-to-back merges will cause the first merge's workflow to fail but
6578
# the second's will succeed.
66-
-
67-
run: pnpm publish
68-
env:
69-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
70-
#-
71-
# name: Add package to etherpad organization
72-
# run: pnpm access grant read-write etherpad:developers
73-
# env:
74-
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
79+
#
80+
# Use `npm publish` directly (not `pnpm publish`) because OIDC trusted
81+
# publishing requires npm CLI >= 11.5.1 and `pnpm publish` shells out to
82+
# whichever `npm` is on PATH; calling `npm` directly avoids any shim
83+
# ambiguity.
84+
- name: Publish to npm via OIDC
85+
run: npm publish --provenance --access public

.github/workflows/test-and-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Node.js Package
22
on: [push]
33

4+
# id-token: write must be granted here so the reusable npmpublish workflow
5+
# can request an OIDC token for npm trusted publishing.
6+
permissions:
7+
contents: write
8+
id-token: write
49

510
jobs:
611
backend:
@@ -14,5 +19,8 @@ jobs:
1419
needs:
1520
- backend
1621
- frontend
22+
permissions:
23+
contents: write # for the version bump push
24+
id-token: write # for npm OIDC trusted publishing
1725
uses: ./.github/workflows/npmpublish.yml
1826
secrets: inherit

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ep_print",
33
"description": "Support for printing, works cross browser, supports page breaks",
4-
"version": "0.1.19",
4+
"version": "0.1.20",
55
"author": {
66
"name": "johnyma22",
77
"email": "john@mclear.co.uk",
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"eslint": "^8.57.1",
2424
"eslint-config-etherpad": "^4.0.4",
25-
"typescript": "^6.0.2"
25+
"typescript": "^5.9.3"
2626
},
2727
"scripts": {
2828
"lint": "eslint .",

0 commit comments

Comments
 (0)