diff --git a/.github/workflows/create-plugin-pr.yml b/.github/workflows/create-plugin-pr.yml index 6c4caba..3c71504 100644 --- a/.github/workflows/create-plugin-pr.yml +++ b/.github/workflows/create-plugin-pr.yml @@ -14,7 +14,7 @@ jobs: if: contains(github.event.issue.labels.*.name, 'plugin-submission') runs-on: ubuntu-latest steps: - - uses: actions/github-script@v8 + - uses: actions/github-script@v9 with: script: | const body = context.payload.issue.body ?? ''; @@ -48,7 +48,27 @@ jobs: const status = parseField(body, 'Status'); const minimumVersion = parseField(body, 'Minimum Docusaurus version'); const npmPackagesRaw = parseField(body, 'npm package name(s)'); - const tags = parseCheckboxes(body, 'Tags'); + const submittedTags = parseCheckboxes(body, 'Tags'); + + // These tags curate the directory's highlighted/official listings, so only + // maintainers may apply them — anyone else's selection is stripped below. + const RESTRICTED_TAGS = ['favourite', 'docusaurus']; + const submitter = context.payload.issue.user.login; + let isMaintainer = false; + try { + const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({ + owner: context.repo.owner, + repo: context.repo.repo, + username: submitter, + }); + isMaintainer = permission.permission === 'admin' || permission.permission === 'maintain'; + } catch (e) { + if (e.status !== 404) throw e; + // Not a collaborator — expected for external contributors + } + + const removedTags = isMaintainer ? [] : submittedTags.filter(t => RESTRICTED_TAGS.includes(t)); + const tags = isMaintainer ? submittedTags : submittedTags.filter(t => !RESTRICTED_TAGS.includes(t)); const errors = []; if (!name) errors.push('Plugin name is required'); @@ -190,13 +210,22 @@ jobs: }); // Comment on the issue with the PR link + const successBody = [ + `Thank you for your plugin submission! A draft PR has been created: ${pr.data.html_url}`, + '', + 'A maintainer will review it shortly. Please check the PR for any CI validation errors.', + ]; + + if (removedTags.length > 0) { + successBody.push( + '', + `Note: the ${removedTags.map(t => `\`${t}\``).join(', ')} tag(s) are reserved for maintainers and were removed from your submission. A maintainer can add them back if appropriate.`, + ); + } + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issueNumber, - body: [ - `Thank you for your plugin submission! A draft PR has been created: ${pr.data.html_url}`, - '', - 'A maintainer will review it shortly. Please check the PR for any CI validation errors.', - ].join('\n'), + body: successBody.join('\n'), }); diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0d26af5..c03b5ee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,7 +64,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.sha || github.ref }} fetch-depth: 0 @@ -157,7 +157,7 @@ jobs: - name: Remove label if: ${{ github.event_name == 'pull_request_target' && contains(github.event.label.name, '🚀request-deploy') }} - uses: actions/github-script@v8 + uses: actions/github-script@v9 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -165,7 +165,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - name: ['🚀request-deploy'] + name: '🚀request-deploy' }) # Comment on PR from the fork diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index faa48b6..84602c2 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/contributing/plugins.mdx b/contributing/plugins.mdx index d70399d..377eee9 100644 --- a/contributing/plugins.mdx +++ b/contributing/plugins.mdx @@ -43,7 +43,7 @@ npmPackages: | `description` | Yes | Short, one-sentence description | | `preview` | Yes | URL to a preview image, or `null` to auto-generate | | `website` | Yes | Public website or repository URL | -| `source` | No | Source code URL (required for acceptance) | +| `source` | No | Source code URL — required if the plugin is open source, `null` or omitted if closed source | | `author` | No | Your GitHub username or organisation name | | `tags` | No | See [available tags](#tags) below | | `minimumVersion` | No | Minimum Docusaurus version, e.g. `3.0.0`, or `null` | diff --git a/package.json b/package.json index 3b13b13..4ef2124 100644 --- a/package.json +++ b/package.json @@ -58,15 +58,15 @@ "@docusaurus/tsconfig": "^3.10.1", "@docusaurus/types": "^3.10.1", "@types/jest": "^30.0.0", - "@types/node": "^26.0.1", + "@types/node": "^26.1.0", "@types/react": "^19.2.17", "jest": "^30.4.2", - "prettier": "3.9.3", + "prettier": "3.9.4", "prettier-plugin-css-order": "2.2.0", "prop-types": "^15.8.1", "react-waypoint": "^10.3.0", "typescript": "^6.0.3", - "webpack": "^5.108.2" + "webpack": "^5.108.3" }, "browserslist": { "production": [ diff --git a/yarn.lock b/yarn.lock index df1ac33..faf08de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6868,12 +6868,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^26.0.1": - version: 26.0.1 - resolution: "@types/node@npm:26.0.1" +"@types/node@npm:^26.1.0": + version: 26.1.0 + resolution: "@types/node@npm:26.1.0" dependencies: undici-types: "npm:~8.3.0" - checksum: 10c0/31d204333c70124da6bcac7d1f27d8980149fe3f95a8419bfcd19c3e5823705c0e370d71ac34399352e1263b2d5fc41c87af964ec81e5a05a32224d65d8d224e + checksum: 10c0/61c22ad1ef215e24138cb8b7368fb68bab9de4c123b3f23d411749b015ba1b7d22f878ad54add26a0b69068d7e07c04af665069d8571b6c6c3b9b2fb73b7bd91 languageName: node linkType: hard @@ -9842,7 +9842,7 @@ __metadata: "@popperjs/core": "npm:^2.11.8" "@swc/core": "npm:^1.15.43" "@types/jest": "npm:^30.0.0" - "@types/node": "npm:^26.0.1" + "@types/node": "npm:^26.1.0" "@types/react": "npm:^19.2.17" "@types/react-dom": "npm:^19.2.3" clsx: "npm:^2.1.1" @@ -9850,7 +9850,7 @@ __metadata: docusaurus-remark-plugin-tab-blocks: "npm:^4.0.0" git-url-parse: "npm:^16.1.0" jest: "npm:^30.4.2" - prettier: "npm:3.9.3" + prettier: "npm:3.9.4" prettier-plugin-css-order: "npm:2.2.0" prism-react-renderer: "npm:^2.4.1" prop-types: "npm:^15.8.1" @@ -9866,7 +9866,7 @@ __metadata: sass: "npm:^1.101.0" swc-loader: "npm:^0.2.7" typescript: "npm:^6.0.3" - webpack: "npm:^5.108.2" + webpack: "npm:^5.108.3" dependenciesMeta: "@docusaurus/tsconfig": unplugged: true @@ -16707,12 +16707,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.9.3": - version: 3.9.3 - resolution: "prettier@npm:3.9.3" +"prettier@npm:3.9.4": + version: 3.9.4 + resolution: "prettier@npm:3.9.4" bin: prettier: bin/prettier.cjs - checksum: 10c0/56623a03f0a1a791413b76458dbcab1dff8e5a7d02744be98ccc589a3a8cf8371dda8fba68f2d2336ded8475ed40f6eaf66f0f4d39df33235656018f64d2fdac + checksum: 10c0/dc6ec13d692745c6b7e7bf39beda9eb1b3b76c619118319bce393928c392264b1273337c75f80499695e165affefc7b3a9d2ebb18983af0a8f4dfbb2f45f6ff3 languageName: node linkType: hard @@ -19745,9 +19745,9 @@ __metadata: languageName: node linkType: hard -"webpack@npm:^5.108.2": - version: 5.108.2 - resolution: "webpack@npm:5.108.2" +"webpack@npm:^5.108.3": + version: 5.108.3 + resolution: "webpack@npm:5.108.3" dependencies: "@types/estree": "npm:^1.0.8" "@types/json-schema": "npm:^7.0.15" @@ -19776,7 +19776,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 10c0/0415339267d6759502022d0fe9a18f59d8c5d5bd08c42566f6591b86814073ee63078ad90344e45ed8bd6f2de13d58623a98b4bf47a620fca356b997da3d7f74 + checksum: 10c0/96a0e17e5443ed179be24ee91fe2d5aca25aad8cf61e3ea469219b1fe9f970642ae40e0f32ad84888e8867c7141e2b8b2eaf32c290edce2e93762482231b7dad languageName: node linkType: hard