Skip to content

Commit ac7ad72

Browse files
committed
WIP: Notify linked issues...
1 parent 4ce48e9 commit ac7ad72

File tree

7 files changed

+219
-0
lines changed

7 files changed

+219
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Automation: Notify issues for release"
2+
on:
3+
release:
4+
types:
5+
- published
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Which version to notify issues for
10+
required: false
11+
12+
# This workflow is triggered when a release is published
13+
jobs:
14+
release-comment-issues:
15+
runs-on: ubuntu-20.04
16+
name: 'Notify issues that are included in a release'
17+
18+
steps:
19+
- name: Get version
20+
id: get_version
21+
run: echo "version=${{ github.event.inputs.version || github.event.release.tag_name }}" >> $GITHUB_OUTPUT
22+
23+
- name: Comment on linked issues that are mentioned in release
24+
if: steps.get_version.outputs.version != ''
25+
uses: ./dev-packages/release-comment-issues-gh-action
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
version: ${{ steps.get_version.outputs.version }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
extends: ['../../.eslintrc.js'],
3+
parserOptions: {
4+
sourceType: 'module',
5+
ecmaVersion: 'latest',
6+
},
7+
8+
overrides: [
9+
{
10+
files: ['*.mjs'],
11+
extends: ['@sentry-internal/sdk/src/base'],
12+
},
13+
],
14+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'release-comment-issues-gh-action'
2+
description: 'An internal Github Action to comment on related issues when a release is published.'
3+
inputs:
4+
github_token:
5+
required: true
6+
description: 'a github access token'
7+
version:
8+
required: true
9+
description: 'Which version was released'
10+
runs:
11+
using: 'node20'
12+
main: 'index.mjs'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as core from '@actions/core';
2+
import { context, getOctokit } from '@actions/github';
3+
4+
async function run() {
5+
const { getInput } = core;
6+
7+
const githubToken = getInput('gh_token');
8+
const version = getInput('version');
9+
10+
if (!githubToken || !version) {
11+
return;
12+
}
13+
14+
const { repo } = context;
15+
const {owner} = repo;
16+
17+
const octokit = getOctokit(githubToken);
18+
19+
const release = await octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
20+
owner,
21+
repo,
22+
tag: version,
23+
headers: {
24+
'X-GitHub-Api-Version': '2022-11-28'
25+
}
26+
});
27+
28+
console.log(release);
29+
}
30+
31+
run();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@sentry-internal/release-comment-issues-gh-action",
3+
"description": "An internal Github Action to comment on related issues when a release is published.",
4+
"version": "8.31.0",
5+
"license": "MIT",
6+
"engines": {
7+
"node": ">=18"
8+
},
9+
"private": true,
10+
"main": "index.mjs",
11+
"type": "module",
12+
"scripts": {
13+
"lint": "eslint . --format stylish",
14+
"fix": "eslint . --format stylish --fix"
15+
},
16+
"dependencies": {
17+
"@actions/core": "1.10.1",
18+
"@actions/github": "6.0.0"
19+
},
20+
"volta": {
21+
"extends": "../../package.json"
22+
}
23+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"dev-packages/size-limit-gh-action",
9494
"dev-packages/clear-cache-gh-action",
9595
"dev-packages/external-contributor-gh-action",
96+
"dev-packages/release-comment-issues-gh-action",
9697
"dev-packages/rollup-utils"
9798
],
9899
"devDependencies": {

yarn.lock

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
dependencies:
2828
"@actions/io" "^1.0.1"
2929

30+
"@actions/[email protected]":
31+
version "6.0.0"
32+
resolved "https://registry.yarnpkg.com/@actions/github/-/github-6.0.0.tgz#65883433f9d81521b782a64cc1fd45eef2191ea7"
33+
integrity sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==
34+
dependencies:
35+
"@actions/http-client" "^2.2.0"
36+
"@octokit/core" "^5.0.1"
37+
"@octokit/plugin-paginate-rest" "^9.0.0"
38+
"@octokit/plugin-rest-endpoint-methods" "^10.0.0"
39+
3040
"@actions/github@^5.0.0":
3141
version "5.1.1"
3242
resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.1.1.tgz#40b9b9e1323a5efcf4ff7dadd33d8ea51651bbcb"
@@ -53,6 +63,14 @@
5363
tunnel "^0.0.6"
5464
undici "^5.25.4"
5565

66+
"@actions/http-client@^2.2.0":
67+
version "2.2.3"
68+
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674"
69+
integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==
70+
dependencies:
71+
tunnel "^0.0.6"
72+
undici "^5.25.4"
73+
5674
"@actions/[email protected]", "@actions/io@^1.0.1":
5775
version "1.1.3"
5876
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71"
@@ -6747,6 +6765,11 @@
67476765
dependencies:
67486766
"@octokit/types" "^8.0.0"
67496767

6768+
"@octokit/auth-token@^4.0.0":
6769+
version "4.0.0"
6770+
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7"
6771+
integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==
6772+
67506773
"@octokit/core@^3.6.0":
67516774
version "3.6.0"
67526775
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085"
@@ -6786,6 +6809,19 @@
67866809
before-after-hook "^2.2.0"
67876810
universal-user-agent "^6.0.0"
67886811

6812+
"@octokit/core@^5.0.1":
6813+
version "5.2.0"
6814+
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.2.0.tgz#ddbeaefc6b44a39834e1bb2e58a49a117672a7ea"
6815+
integrity sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==
6816+
dependencies:
6817+
"@octokit/auth-token" "^4.0.0"
6818+
"@octokit/graphql" "^7.1.0"
6819+
"@octokit/request" "^8.3.1"
6820+
"@octokit/request-error" "^5.1.0"
6821+
"@octokit/types" "^13.0.0"
6822+
before-after-hook "^2.2.0"
6823+
universal-user-agent "^6.0.0"
6824+
67896825
"@octokit/endpoint@^6.0.1":
67906826
version "6.0.12"
67916827
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658"
@@ -6804,6 +6840,14 @@
68046840
is-plain-object "^5.0.0"
68056841
universal-user-agent "^6.0.0"
68066842

6843+
"@octokit/endpoint@^9.0.1":
6844+
version "9.0.5"
6845+
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-9.0.5.tgz#e6c0ee684e307614c02fc6ac12274c50da465c44"
6846+
integrity sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==
6847+
dependencies:
6848+
"@octokit/types" "^13.1.0"
6849+
universal-user-agent "^6.0.0"
6850+
68076851
"@octokit/graphql@^4.5.8":
68086852
version "4.8.0"
68096853
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3"
@@ -6822,6 +6866,15 @@
68226866
"@octokit/types" "^8.0.0"
68236867
universal-user-agent "^6.0.0"
68246868

6869+
"@octokit/graphql@^7.1.0":
6870+
version "7.1.0"
6871+
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-7.1.0.tgz#9bc1c5de92f026648131f04101cab949eeffe4e0"
6872+
integrity sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==
6873+
dependencies:
6874+
"@octokit/request" "^8.3.0"
6875+
"@octokit/types" "^13.0.0"
6876+
universal-user-agent "^6.0.0"
6877+
68256878
"@octokit/openapi-types@^12.11.0":
68266879
version "12.11.0"
68276880
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0"
@@ -6842,6 +6895,16 @@
68426895
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69"
68436896
integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==
68446897

6898+
"@octokit/openapi-types@^20.0.0":
6899+
version "20.0.0"
6900+
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-20.0.0.tgz#9ec2daa0090eeb865ee147636e0c00f73790c6e5"
6901+
integrity sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==
6902+
6903+
"@octokit/openapi-types@^22.2.0":
6904+
version "22.2.0"
6905+
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-22.2.0.tgz#75aa7dcd440821d99def6a60b5f014207ae4968e"
6906+
integrity sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==
6907+
68456908
"@octokit/[email protected]":
68466909
version "6.0.1"
68476910
resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437"
@@ -6869,11 +6932,25 @@
68696932
"@octokit/tsconfig" "^1.0.2"
68706933
"@octokit/types" "^9.2.3"
68716934

6935+
"@octokit/plugin-paginate-rest@^9.0.0":
6936+
version "9.2.1"
6937+
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz#2e2a2f0f52c9a4b1da1a3aa17dabe3c459b9e401"
6938+
integrity sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==
6939+
dependencies:
6940+
"@octokit/types" "^12.6.0"
6941+
68726942
"@octokit/plugin-request-log@^1.0.4":
68736943
version "1.0.4"
68746944
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85"
68756945
integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==
68766946

6947+
"@octokit/plugin-rest-endpoint-methods@^10.0.0":
6948+
version "10.4.1"
6949+
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz#41ba478a558b9f554793075b2e20cd2ef973be17"
6950+
integrity sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==
6951+
dependencies:
6952+
"@octokit/types" "^12.6.0"
6953+
68776954
"@octokit/plugin-rest-endpoint-methods@^5.13.0":
68786955
version "5.16.2"
68796956
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342"
@@ -6915,6 +6992,15 @@
69156992
deprecation "^2.0.0"
69166993
once "^1.4.0"
69176994

6995+
"@octokit/request-error@^5.1.0":
6996+
version "5.1.0"
6997+
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-5.1.0.tgz#ee4138538d08c81a60be3f320cd71063064a3b30"
6998+
integrity sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==
6999+
dependencies:
7000+
"@octokit/types" "^13.1.0"
7001+
deprecation "^2.0.0"
7002+
once "^1.4.0"
7003+
69187004
"@octokit/request@^5.6.0", "@octokit/request@^5.6.3":
69197005
version "5.6.3"
69207006
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0"
@@ -6939,6 +7025,16 @@
69397025
node-fetch "^2.6.7"
69407026
universal-user-agent "^6.0.0"
69417027

7028+
"@octokit/request@^8.3.0", "@octokit/request@^8.3.1":
7029+
version "8.4.0"
7030+
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-8.4.0.tgz#7f4b7b1daa3d1f48c0977ad8fffa2c18adef8974"
7031+
integrity sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==
7032+
dependencies:
7033+
"@octokit/endpoint" "^9.0.1"
7034+
"@octokit/request-error" "^5.1.0"
7035+
"@octokit/types" "^13.1.0"
7036+
universal-user-agent "^6.0.0"
7037+
69427038
"@octokit/[email protected]":
69437039
version "19.0.11"
69447040
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-19.0.11.tgz#2ae01634fed4bd1fca5b642767205ed3fd36177c"
@@ -6971,6 +7067,20 @@
69717067
dependencies:
69727068
"@octokit/openapi-types" "^18.0.0"
69737069

7070+
"@octokit/types@^12.6.0":
7071+
version "12.6.0"
7072+
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.6.0.tgz#8100fb9eeedfe083aae66473bd97b15b62aedcb2"
7073+
integrity sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==
7074+
dependencies:
7075+
"@octokit/openapi-types" "^20.0.0"
7076+
7077+
"@octokit/types@^13.0.0", "@octokit/types@^13.1.0":
7078+
version "13.5.1"
7079+
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-13.5.1.tgz#5685a91f295195ddfff39723b093b0df9609ce6e"
7080+
integrity sha512-F41lGiWBKPIWPBgjSvaDXTTQptBujnozENAK3S//nj7xsFdYdirImKlBB/hTjr+Vii68SM+8jG3UJWRa6DMuDA==
7081+
dependencies:
7082+
"@octokit/openapi-types" "^22.2.0"
7083+
69747084
"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0":
69757085
version "6.41.0"
69767086
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04"

0 commit comments

Comments
 (0)