Skip to content

ci: fix release comments for issues and pull requests #4940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/createIssueCommentsForRelease.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const commitShaRegExp = /commit\/(?<sha>\w{40})/gm;
export default async function run({ github, context }) {
const { version } = JSON.parse(readFileSync(new URL('../lerna.json', import.meta.url)).toString());

const { data: release } = await github.repos.getReleaseByTag({
const { data: release } = await github.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
owner: context.repo.owner,
repo: context.repo.repo,
tag: `v${version}`
Expand Down Expand Up @@ -43,5 +43,11 @@ export default async function run({ github, context }) {
env: process.env
};

await issueCommenter({}, semanticReleaseContext);
const Octokit = new Proxy(class {}, {
construct(target, argArray, newTarget) {
return github;
}
});

await issueCommenter({}, semanticReleaseContext, { Octokit });
}
8 changes: 4 additions & 4 deletions .github/workflows/release-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 16
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install Dependencies
run: |
yarn install --immutable
yarn add @octokit/[email protected] @octokit/[email protected]
env:
CYPRESS_INSTALL_BINARY: 0

### Semantic Release Bot comments for issues and PRs ###
- name: Add release comments to issues and PRs
uses: actions/github-script@v6
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
node-version: 16
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');

await addIssueComments({ github: github.rest, context })
await addIssueComments({ github, context })
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ jobs:
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');

await addIssueComments({ github: github.rest, context })
await addIssueComments({ github, context })

63 changes: 35 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2876,11 +2876,9 @@ __metadata:
linkType: hard

"@octokit/auth-token@npm:^3.0.0":
version: 3.0.3
resolution: "@octokit/auth-token@npm:3.0.3"
dependencies:
"@octokit/types": ^9.0.0
checksum: 9b3f569cec1b7e0aa88ab6da68aed4b49b6652261bd957257541fabaf6a4d4ed99f908153cc3dd2fe15b8b0ccaff8caaafaa50bb1a4de3925b0954a47cca1900
version: 3.0.4
resolution: "@octokit/auth-token@npm:3.0.4"
checksum: 42f533a873d4192e6df406b3176141c1f95287423ebdc4cf23a38bb77ee00ccbc0e60e3fbd5874234fc2ed2e67bbc6035e3b0561dacc1d078adb5c4ced3579e3
languageName: node
linkType: hard

Expand All @@ -2892,8 +2890,8 @@ __metadata:
linkType: hard

"@octokit/core@npm:^4.2.1":
version: 4.2.1
resolution: "@octokit/core@npm:4.2.1"
version: 4.2.4
resolution: "@octokit/core@npm:4.2.4"
dependencies:
"@octokit/auth-token": ^3.0.0
"@octokit/graphql": ^5.0.0
Expand All @@ -2902,7 +2900,7 @@ __metadata:
"@octokit/types": ^9.0.0
before-after-hook: ^2.2.0
universal-user-agent: ^6.0.0
checksum: f82d52e937e12da1c7c163341c845b8e27e7fa75678f5e5954e6fa017a94f1833d6e5c4e43f0be796fbfea9dc5e1137087f655dbd5acb3d57879e1b28568e0a9
checksum: ac8ab47440a31b0228a034aacac6994b64d6b073ad5b688b4c5157fc5ee0d1af1c926e6087bf17fd7244ee9c5998839da89065a90819bde4a97cb77d4edf58a6
languageName: node
linkType: hard

Expand All @@ -2922,13 +2920,13 @@ __metadata:
linkType: hard

"@octokit/endpoint@npm:^7.0.0":
version: 7.0.5
resolution: "@octokit/endpoint@npm:7.0.5"
version: 7.0.6
resolution: "@octokit/endpoint@npm:7.0.6"
dependencies:
"@octokit/types": ^9.0.0
is-plain-object: ^5.0.0
universal-user-agent: ^6.0.0
checksum: 81c9e9eabf50e48940cceff7c4d7fbc9327190296507cfe8a199ea00cd492caf8f18a841caf4e3619828924b481996eb16091826db6b5a649bee44c8718ecaa9
checksum: 7caebf30ceec50eb7f253341ed419df355232f03d4638a95c178ee96620400db7e4a5e15d89773fe14db19b8653d4ab4cc81b2e93ca0c760b4e0f7eb7ad80301
languageName: node
linkType: hard

Expand All @@ -2944,13 +2942,13 @@ __metadata:
linkType: hard

"@octokit/graphql@npm:^5.0.0":
version: 5.0.5
resolution: "@octokit/graphql@npm:5.0.5"
version: 5.0.6
resolution: "@octokit/graphql@npm:5.0.6"
dependencies:
"@octokit/request": ^6.0.0
"@octokit/types": ^9.0.0
universal-user-agent: ^6.0.0
checksum: eb2d1a6305a3d1f55ff0ce92fb88b677f0bb789757152d58a79ef61171fb65ecf6fe18d6c27e236c0cee6a0c2600c2cb8370f5ac7184f8e9361c085aa4555bb1
checksum: 7be545d348ef31dcab0a2478dd64d5746419a2f82f61459c774602bcf8a9b577989c18001f50b03f5f61a3d9e34203bdc021a4e4d75ff2d981e8c9c09cf8a65c
languageName: node
linkType: hard

Expand Down Expand Up @@ -3012,13 +3010,13 @@ __metadata:
linkType: hard

"@octokit/plugin-rest-endpoint-methods@npm:^7.1.2":
version: 7.2.1
resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.2.1"
version: 7.2.3
resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.2.3"
dependencies:
"@octokit/types": ^9.3.1
"@octokit/types": ^10.0.0
peerDependencies:
"@octokit/core": ">=3"
checksum: 069e52305f9d2e85fb83819a80860e526b9da2e0936640975f749a2c63020674053e6f4b5af771651a93320172579b0779bf3d663c8adcd090f152aac29f4ad4
checksum: 21dfb98514dbe900c29cddb13b335bbce43d613800c6b17eba3c1fd31d17e69c1960f3067f7bf864bb38fdd5043391f4a23edee42729d8c7fbabd00569a80336
languageName: node
linkType: hard

Expand Down Expand Up @@ -3070,29 +3068,29 @@ __metadata:
linkType: hard

"@octokit/request@npm:^6.0.0":
version: 6.2.3
resolution: "@octokit/request@npm:6.2.3"
version: 6.2.8
resolution: "@octokit/request@npm:6.2.8"
dependencies:
"@octokit/endpoint": ^7.0.0
"@octokit/request-error": ^3.0.0
"@octokit/types": ^9.0.0
is-plain-object: ^5.0.0
node-fetch: ^2.6.7
universal-user-agent: ^6.0.0
checksum: fef4097be8375d20bb0b3276d8a3adf866ec628f2b0664d334f3c29b92157da847899497abdc7a5be540053819b55564990543175ad48f04e9e6f25f0395d4d3
checksum: 3747106f50d7c462131ff995b13defdd78024b7becc40283f4ac9ea0af2391ff33a0bb476a05aa710346fe766d20254979079a1d6f626112015ba271fe38f3e2
languageName: node
linkType: hard

"@octokit/request@npm:^8.0.1, @octokit/request@npm:^8.0.2":
version: 8.1.0
resolution: "@octokit/request@npm:8.1.0"
version: 8.1.1
resolution: "@octokit/request@npm:8.1.1"
dependencies:
"@octokit/endpoint": ^9.0.0
"@octokit/request-error": ^5.0.0
"@octokit/types": ^11.1.0
is-plain-object: ^5.0.0
universal-user-agent: ^6.0.0
checksum: 00f71e1ca0bff84a1a903ca9f79a7837aac830cae3560d44f03272d062ef98e5a8170fdab8a47169c41db88e6894717cc71387604486d559f9eae409fab93f6f
checksum: dec3ba2cba14739159cd8d1653ad8ac6d58095e4ac294d312d20ce2c63c60c3cad2e5499137244dba3d681fd5cd7f74b4b5d4df024a19c0ee1831204e5a3a894
languageName: node
linkType: hard

Expand All @@ -3115,6 +3113,15 @@ __metadata:
languageName: node
linkType: hard

"@octokit/types@npm:^10.0.0":
version: 10.0.0
resolution: "@octokit/types@npm:10.0.0"
dependencies:
"@octokit/openapi-types": ^18.0.0
checksum: 8aafba2ff0cd2435fb70c291bf75ed071c0fa8a865cf6169648732068a35dec7b85a345851f18920ec5f3e94ee0e954988485caac0da09ec3f6781cc44fe153a
languageName: node
linkType: hard

"@octokit/types@npm:^11.0.0, @octokit/types@npm:^11.1.0":
version: 11.1.0
resolution: "@octokit/types@npm:11.1.0"
Expand All @@ -3124,12 +3131,12 @@ __metadata:
languageName: node
linkType: hard

"@octokit/types@npm:^9.0.0, @octokit/types@npm:^9.2.3, @octokit/types@npm:^9.3.1":
version: 9.3.1
resolution: "@octokit/types@npm:9.3.1"
"@octokit/types@npm:^9.0.0, @octokit/types@npm:^9.2.3":
version: 9.3.2
resolution: "@octokit/types@npm:9.3.2"
dependencies:
"@octokit/openapi-types": ^18.0.0
checksum: 56fce104114730553c79175261f288a263055af4a6de848130fa964940460ee4fe8fa610f33dd0862c2c178d7d97f703e44a799898f3b52583e7ce5ae595f8ff
checksum: f55d096aaed3e04b8308d4422104fb888f355988056ba7b7ef0a4c397b8a3e54290d7827b06774dbe0c9ce55280b00db486286954f9c265aa6b03091026d9da8
languageName: node
linkType: hard

Expand Down