Skip to content

Commit 19c9d87

Browse files
add issue creation for GemsViewsBuilder repo
1 parent 21d8ee1 commit 19c9d87

1 file changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/notify-gemspy-release.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Notify dependents — GemsPy new release
33
on:
44
release:
55
types: [published]
6-
workflow_dispatch:
76

87
permissions:
98
contents: read
@@ -116,3 +115,51 @@ jobs:
116115
});
117116
118117
console.log(`Issue created in AntaresLegacyModels-to-GEMS-Converter: #${result.data.number} — ${result.data.html_url}`);
118+
119+
- name: Notify GEMS-ViewsBuilder repository
120+
uses: actions/github-script@v9
121+
with:
122+
github-token: ${{ secrets.GEMS_VIEWS_BUILDER_PAT }}
123+
script: |
124+
const version = '${{ steps.version.outputs.version }}';
125+
const title = `[GEMSPY UPDATE] New release: v${version}`;
126+
const owner = context.repo.owner;
127+
128+
const existing = await github.rest.issues.listForRepo({
129+
owner: owner,
130+
repo: 'GEMS-ViewsBuilder',
131+
state: 'open',
132+
});
133+
134+
const duplicate = existing.data.find(i => i.title.includes(`v${version}`));
135+
if (duplicate) {
136+
console.log(`Issue already exists in GEMS-ViewsBuilder: #${duplicate.number} — skipping.`);
137+
return;
138+
}
139+
140+
const body = [
141+
'> This issue was automatically created by the `notify-gemspy-release` workflow in GemsPy.',
142+
'',
143+
'## New Version Detected',
144+
'',
145+
'| | |',
146+
'|---|---|',
147+
`| **New version** | \`${version}\` |`,
148+
`| **PyPI page** | https://pypi.org/project/gemspy/${version}/ |`,
149+
`| **Release notes** | https://github.com/${owner}/GemsPy/releases/tag/v${version} |`,
150+
'',
151+
'## Triage',
152+
'',
153+
'- [ ] GemsPy changelog reviewed',
154+
'- [ ] `gemspy` dependency version updated in `pyproject.toml` (if new features or fixes are required)',
155+
'- [ ] No action needed (if release has no impact on GEMS-ViewsBuilder)',
156+
].join('\n');
157+
158+
const result = await github.rest.issues.create({
159+
owner: owner,
160+
repo: 'GEMS-ViewsBuilder',
161+
title: title,
162+
body: body,
163+
});
164+
165+
console.log(`Issue created in GEMS-ViewsBuilder: #${result.data.number} — ${result.data.html_url}`);

0 commit comments

Comments
 (0)