From 76a6e1a6be949983d7a1b884f1b197e57a1c629b Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 11:33:48 -0800 Subject: [PATCH 1/6] Fix npm pinning (again) --- .github/package-lock.json | 27 +++++++++++++++++++++++ .github/package.json | 9 ++++++++ .github/workflows/assign-issue-owners.yml | 3 ++- .gitignore | 3 +++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/package-lock.json create mode 100644 .github/package.json diff --git a/.github/package-lock.json b/.github/package-lock.json new file mode 100644 index 000000000..f5f878cad --- /dev/null +++ b/.github/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "assign-issue-owners-workflow", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "assign-issue-owners-workflow", + "version": "1.0.0", + "dependencies": { + "yaml": "2.8.1" + } + }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + } + } +} diff --git a/.github/package.json b/.github/package.json new file mode 100644 index 000000000..d2d1e6e51 --- /dev/null +++ b/.github/package.json @@ -0,0 +1,9 @@ +{ + "name": "workflows", + "version": "1.0.0", + "description": "Dependencies for GitHub Action workflows", + "private": true, + "dependencies": { + "yaml": "2.8.1" + } +} diff --git a/.github/workflows/assign-issue-owners.yml b/.github/workflows/assign-issue-owners.yml index ee64f176a..23d728ac7 100644 --- a/.github/workflows/assign-issue-owners.yml +++ b/.github/workflows/assign-issue-owners.yml @@ -23,7 +23,8 @@ jobs: uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 - name: Install yaml dependency used below - run: npm install yaml@2.8.1 --integrity=sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw== + run: npm ci + working-directory: .github - name: Parse component label and assign owners uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 diff --git a/.gitignore b/.gitignore index 4743c99e3..6778de97f 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,6 @@ bin # Gradle build scans build-scan.txt + +# Node +node_modules From 1e1d73f611df517bab61f211eee840236ebefff1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 11:37:14 -0800 Subject: [PATCH 2/6] Add NODE_PATH for yaml module --- .github/package-lock.json | 27 ----------- .github/package.json | 9 ---- .github/workflows/assign-issue-owners.yml | 59 +++-------------------- 3 files changed, 6 insertions(+), 89 deletions(-) delete mode 100644 .github/package-lock.json delete mode 100644 .github/package.json diff --git a/.github/package-lock.json b/.github/package-lock.json deleted file mode 100644 index f5f878cad..000000000 --- a/.github/package-lock.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "assign-issue-owners-workflow", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "assign-issue-owners-workflow", - "version": "1.0.0", - "dependencies": { - "yaml": "2.8.1" - } - }, - "node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - } - } -} diff --git a/.github/package.json b/.github/package.json deleted file mode 100644 index d2d1e6e51..000000000 --- a/.github/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "workflows", - "version": "1.0.0", - "description": "Dependencies for GitHub Action workflows", - "private": true, - "dependencies": { - "yaml": "2.8.1" - } -} diff --git a/.github/workflows/assign-issue-owners.yml b/.github/workflows/assign-issue-owners.yml index 23d728ac7..fa821f179 100644 --- a/.github/workflows/assign-issue-owners.yml +++ b/.github/workflows/assign-issue-owners.yml @@ -21,62 +21,15 @@ jobs: - name: Setup Node.js uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + cache: npm + cache-dependency-path: .github/scripts/package-lock.json - - name: Install yaml dependency used below + - name: Install dependencies run: npm ci - working-directory: .github + working-directory: .github/scripts - name: Parse component label and assign owners uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: - script: | - const fs = require('fs'); - const { parse } = require('yaml'); - - // Extract component name from label - const labelName = context.payload.label.name; - - if (!labelName.startsWith('component:')) { - core.setFailed('Label does not match expected pattern'); - return; - } - - const componentName = labelName.replace('component:', ''); - console.log(`Processing component: ${componentName}`); - - // Read and parse component_owners.yml - const yamlContent = fs.readFileSync('.github/component_owners.yml', 'utf8'); - const data = parse(yamlContent); - - if (!data || !data.components) { - core.setFailed('Invalid component_owners.yml structure'); - return; - } - - const components = data.components; - - if (!(componentName in components)) { - core.setFailed(`Component '${componentName}' not found in component_owners.yml`); - return; - } - - const owners = components[componentName]; - - if (!owners || owners.length === 0) { - core.setFailed(`No owners found for component '${componentName}'`); - return; - } - - console.log(`Found owners: ${owners.join(', ')}`); - - // Assign the issue to the owners - const issueNumber = context.payload.issue.number; - - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - assignees: owners - }); - - console.log(`Successfully assigned issue #${issueNumber} to ${owners.join(', ')}`); + script-path: .github/scripts/assign-issue-owners.js From 254e05f47c50f0061377c7e7c88482f1439597ea Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 11:42:40 -0800 Subject: [PATCH 3/6] Add package files --- .github/scripts/package-lock.json | 27 +++++++++++++++++++++++++++ .github/scripts/package.json | 9 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/scripts/package-lock.json create mode 100644 .github/scripts/package.json diff --git a/.github/scripts/package-lock.json b/.github/scripts/package-lock.json new file mode 100644 index 000000000..f5f878cad --- /dev/null +++ b/.github/scripts/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "assign-issue-owners-workflow", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "assign-issue-owners-workflow", + "version": "1.0.0", + "dependencies": { + "yaml": "2.8.1" + } + }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + } + } +} diff --git a/.github/scripts/package.json b/.github/scripts/package.json new file mode 100644 index 000000000..d2d1e6e51 --- /dev/null +++ b/.github/scripts/package.json @@ -0,0 +1,9 @@ +{ + "name": "workflows", + "version": "1.0.0", + "description": "Dependencies for GitHub Action workflows", + "private": true, + "dependencies": { + "yaml": "2.8.1" + } +} From f1f9821a8fc5c92c2ab9eaad501ca35f7904fca6 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 11:43:38 -0800 Subject: [PATCH 4/6] Fix script loading --- .github/workflows/assign-issue-owners.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/assign-issue-owners.yml b/.github/workflows/assign-issue-owners.yml index fa821f179..57f5fadbf 100644 --- a/.github/workflows/assign-issue-owners.yml +++ b/.github/workflows/assign-issue-owners.yml @@ -31,5 +31,9 @@ jobs: - name: Parse component label and assign owners uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + env: + NODE_PATH: ${{ github.workspace }}/.github/scripts/node_modules with: - script-path: .github/scripts/assign-issue-owners.js + script: | + const script = require('./.github/scripts/assign-issue-owners.js'); + await script({ github, context, core }); From 64aaa247fd49b4b32ae0b7b6457b5cfb30b2fbf7 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 11:44:27 -0800 Subject: [PATCH 5/6] Add script file --- .github/scripts/assign-issue-owners.js | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/scripts/assign-issue-owners.js diff --git a/.github/scripts/assign-issue-owners.js b/.github/scripts/assign-issue-owners.js new file mode 100644 index 000000000..5558f2e1a --- /dev/null +++ b/.github/scripts/assign-issue-owners.js @@ -0,0 +1,52 @@ +const fs = require('fs'); +const { parse } = require('yaml'); + +module.exports = async ({ github, context, core }) => { + // Extract component name from label + const labelName = context.payload.label.name; + + if (!labelName.startsWith('component:')) { + core.setFailed('Label does not match expected pattern'); + return; + } + + const componentName = labelName.replace('component:', ''); + console.log(`Processing component: ${componentName}`); + + // Read and parse component_owners.yml + const yamlContent = fs.readFileSync('.github/component_owners.yml', 'utf8'); + const data = parse(yamlContent); + + if (!data || !data.components) { + core.setFailed('Invalid component_owners.yml structure'); + return; + } + + const components = data.components; + + if (!(componentName in components)) { + core.setFailed(`Component '${componentName}' not found in component_owners.yml`); + return; + } + + const owners = components[componentName]; + + if (!owners || owners.length === 0) { + core.setFailed(`No owners found for component '${componentName}'`); + return; + } + + console.log(`Found owners: ${owners.join(', ')}`); + + // Assign the issue to the owners + const issueNumber = context.payload.issue.number; + + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + assignees: owners + }); + + console.log(`Successfully assigned issue #${issueNumber} to ${owners.join(', ')}`); +}; From d46ab0cda29e515e942b0d573aeac8fc6c3fddd2 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 21 Nov 2025 13:06:30 -0800 Subject: [PATCH 6/6] Simplify workflow: use plain Node.js script instead of github-script action --- .github/scripts/assign-issue-owners.js | 42 +++-- .github/scripts/package-lock.json | 217 +++++++++++++++++++++- .github/scripts/package.json | 1 + .github/workflows/assign-issue-owners.yml | 14 +- 4 files changed, 249 insertions(+), 25 deletions(-) diff --git a/.github/scripts/assign-issue-owners.js b/.github/scripts/assign-issue-owners.js index 5558f2e1a..1bf692ccf 100644 --- a/.github/scripts/assign-issue-owners.js +++ b/.github/scripts/assign-issue-owners.js @@ -1,13 +1,18 @@ const fs = require('fs'); const { parse } = require('yaml'); +const { Octokit } = require('@octokit/rest'); -module.exports = async ({ github, context, core }) => { - // Extract component name from label - const labelName = context.payload.label.name; +async function main() { + // Get inputs from environment + const token = process.env.GITHUB_TOKEN; + const labelName = process.env.LABEL_NAME; + const issueNumber = parseInt(process.env.ISSUE_NUMBER); + const owner = process.env.REPO_OWNER; + const repo = process.env.REPO_NAME; if (!labelName.startsWith('component:')) { - core.setFailed('Label does not match expected pattern'); - return; + console.error('Label does not match expected pattern'); + process.exit(1); } const componentName = labelName.replace('component:', ''); @@ -18,35 +23,40 @@ module.exports = async ({ github, context, core }) => { const data = parse(yamlContent); if (!data || !data.components) { - core.setFailed('Invalid component_owners.yml structure'); - return; + console.error('Invalid component_owners.yml structure'); + process.exit(1); } const components = data.components; if (!(componentName in components)) { - core.setFailed(`Component '${componentName}' not found in component_owners.yml`); - return; + console.error(`Component '${componentName}' not found in component_owners.yml`); + process.exit(1); } const owners = components[componentName]; if (!owners || owners.length === 0) { - core.setFailed(`No owners found for component '${componentName}'`); - return; + console.error(`No owners found for component '${componentName}'`); + process.exit(1); } console.log(`Found owners: ${owners.join(', ')}`); // Assign the issue to the owners - const issueNumber = context.payload.issue.number; + const octokit = new Octokit({ auth: token }); - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, + await octokit.rest.issues.addAssignees({ + owner, + repo, issue_number: issueNumber, assignees: owners }); console.log(`Successfully assigned issue #${issueNumber} to ${owners.join(', ')}`); -}; +} + +main().catch(error => { + console.error(error); + process.exit(1); +}); diff --git a/.github/scripts/package-lock.json b/.github/scripts/package-lock.json index f5f878cad..c61cff2b6 100644 --- a/.github/scripts/package-lock.json +++ b/.github/scripts/package-lock.json @@ -1,16 +1,229 @@ { - "name": "assign-issue-owners-workflow", + "name": "workflows", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "assign-issue-owners-workflow", + "name": "workflows", "version": "1.0.0", "dependencies": { + "@octokit/rest": "^21.0.2", "yaml": "2.8.1" } }, + "node_modules/@octokit/auth-token": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz", + "integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.6.tgz", + "integrity": "sha512-kIU8SLQkYWGp3pVKiYzA5OSaNF5EE03P/R8zEmmrG6XwOg5oBjXyQVVIauQ0dgau4zYhpZEhJrvIYt6oM+zZZA==", + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^5.0.0", + "@octokit/graphql": "^8.2.2", + "@octokit/request": "^9.2.3", + "@octokit/request-error": "^6.1.8", + "@octokit/types": "^14.0.0", + "before-after-hook": "^3.0.2", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", + "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.2.2.tgz", + "integrity": "sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==", + "license": "MIT", + "dependencies": { + "@octokit/request": "^9.2.3", + "@octokit/types": "^14.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "11.6.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.6.0.tgz", + "integrity": "sha512-n5KPteiF7pWKgBIBJSk8qzoZWcUkza2O6A0za97pMGVrGfPdltxrfmfF5GucHYvHGZD8BdaZmmHGz5cX/3gdpw==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.10.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-5.3.1.tgz", + "integrity": "sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==", + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.5.0.tgz", + "integrity": "sha512-9Pas60Iv9ejO3WlAX3maE1+38c5nqbJXV5GrncEfkndIpZrJ/WPMRd2xYDcPPEt5yzpxcjw9fWNoPhsSGzqKqw==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.10.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "license": "MIT" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/request": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.4.tgz", + "integrity": "sha512-q8ybdytBmxa6KogWlNa818r0k1wlqzNC+yNkcQDECHvQo8Vmstrg18JwqJHdJdUiHD2sjlwBgSm9kHkOKe2iyA==", + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^10.1.4", + "@octokit/request-error": "^6.1.8", + "@octokit/types": "^14.0.0", + "fast-content-type-parse": "^2.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz", + "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/rest": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-21.1.1.tgz", + "integrity": "sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==", + "license": "MIT", + "dependencies": { + "@octokit/core": "^6.1.4", + "@octokit/plugin-paginate-rest": "^11.4.2", + "@octokit/plugin-request-log": "^5.3.1", + "@octokit/plugin-rest-endpoint-methods": "^13.3.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/before-after-hook": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", + "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", + "license": "Apache-2.0" + }, + "node_modules/fast-content-type-parse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", + "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/universal-user-agent": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", + "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", + "license": "ISC" + }, "node_modules/yaml": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", diff --git a/.github/scripts/package.json b/.github/scripts/package.json index d2d1e6e51..84ddde9bd 100644 --- a/.github/scripts/package.json +++ b/.github/scripts/package.json @@ -4,6 +4,7 @@ "description": "Dependencies for GitHub Action workflows", "private": true, "dependencies": { + "@octokit/rest": "^21.0.2", "yaml": "2.8.1" } } diff --git a/.github/workflows/assign-issue-owners.yml b/.github/workflows/assign-issue-owners.yml index 57f5fadbf..c0549f2cf 100644 --- a/.github/workflows/assign-issue-owners.yml +++ b/.github/workflows/assign-issue-owners.yml @@ -29,11 +29,11 @@ jobs: run: npm ci working-directory: .github/scripts - - name: Parse component label and assign owners - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + - name: Assign issue to component owners + run: node .github/scripts/assign-issue-owners.js env: - NODE_PATH: ${{ github.workspace }}/.github/scripts/node_modules - with: - script: | - const script = require('./.github/scripts/assign-issue-owners.js'); - await script({ github, context, core }); + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LABEL_NAME: ${{ github.event.label.name }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + REPO_OWNER: ${{ github.repository_owner }} + REPO_NAME: ${{ github.event.repository.name }}