electron/.github/workflows/issue-opened.yml
dependabot[bot] 051f78dd1d
build(deps): bump actions-cool/issues-helper from 3.6.0 to 3.6.2 (#47905)
Bumps [actions-cool/issues-helper](https://github.com/actions-cool/issues-helper) from 3.6.0 to 3.6.2.
- [Release notes](https://github.com/actions-cool/issues-helper/releases)
- [Changelog](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md)
- [Commits](a610082f8a...50068f49b7)

---
updated-dependencies:
- dependency-name: actions-cool/issues-helper
  dependency-version: 3.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 10:54:25 +02:00

148 lines
6.3 KiB
YAML

name: Issue Opened
on:
issues:
types:
- opened
permissions: {}
jobs:
add-to-issue-triage:
if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Add to Issue Triage
uses: dsanders11/project-actions/add-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
with:
field: Reporter
field-value: ${{ github.event.issue.user.login }}
project-number: 90
token: ${{ steps.generate-token.outputs.token }}
set-labels:
if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- run: npm install @electron/fiddle-core@1.3.3 mdast-util-from-markdown@2.0.0 unist-util-select@5.1.0 semver@7.6.0
- name: Add labels
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: add-labels
env:
ISSUE_BODY: ${{ github.event.issue.body }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const { fromMarkdown } = await import('${{ github.workspace }}/node_modules/mdast-util-from-markdown/index.js');
const { select } = await import('${{ github.workspace }}/node_modules/unist-util-select/index.js');
const semver = await import('${{ github.workspace }}/node_modules/semver/index.js');
const [ owner, repo ] = '${{ github.repository }}'.split('/');
const issue_number = ${{ github.event.issue.number }};
const tree = fromMarkdown(process.env.ISSUE_BODY);
const labels = [];
const electronVersion = select('heading:has(> text[value="Electron Version"]) + paragraph > text', tree)?.value.trim();
if (electronVersion !== undefined) {
// It's possible for multiple versions to be listed -
// for now check for comma or space separated version.
const versions = electronVersion.split(/, | /);
let hasSupportedVersion = false;
for (const version of versions) {
const major = semver.coerce(version, { loose: true })?.major;
if (major) {
const versionLabel = `${major}-x-y`;
let labelExists = false;
try {
await github.rest.issues.getLabel({
owner,
repo,
name: versionLabel,
});
labelExists = true;
} catch {}
const { ElectronVersions } = await import('${{ github.workspace }}/node_modules/@electron/fiddle-core/dist/index.js');
const electronVersions = await ElectronVersions.create(undefined, { ignoreCache: true });
const validVersions = [...electronVersions.supportedMajors, ...electronVersions.prereleaseMajors];
if (validVersions.includes(major)) {
hasSupportedVersion = true;
if (labelExists) {
labels.push(versionLabel);
}
}
}
}
if (!hasSupportedVersion) {
core.setOutput('unsupportedMajor', true);
labels.push('blocked/need-info ❌');
}
}
const operatingSystems = select('heading:has(> text[value="What operating system(s) are you using?"]) + paragraph > text', tree)?.value.trim().split(', ');
const platformLabels = new Set();
for (const operatingSystem of (operatingSystems ?? [])) {
switch (operatingSystem) {
case 'Windows':
platformLabels.add('platform/windows');
break;
case 'macOS':
platformLabels.add('platform/macOS');
break;
case 'Ubuntu':
case 'Other Linux':
platformLabels.add('platform/linux');
break;
}
}
if (platformLabels.size === 3) {
labels.push('platform/all');
} else {
labels.push(...platformLabels);
}
const gistUrl = select('heading:has(> text[value="Testcase Gist URL"]) + paragraph > text', tree)?.value.trim();
if (gistUrl !== undefined && gistUrl.startsWith('https://gist.github.com/')) {
labels.push('has-repro-gist');
}
if (labels.length) {
await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels,
});
}
- name: Create unsupported major comment
if: ${{ steps.add-labels.outputs.unsupportedMajor }}
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3.6.2
with:
actions: 'create-comment'
token: ${{ steps.generate-token.outputs.token }}
body: |
<!-- end-of-life -->
Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
The version of Electron reported in this issue has reached end-of-life and is [no longer supported](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline). If you're still experiencing this issue on a [supported version](https://www.electronjs.org/releases/stable) of Electron, please update this issue to reflect that version of Electron.
Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-info%20%E2%9D%8C label for this reason. This issue will be closed in 10 days if the above is not addressed.