mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix error when evaluating
This commit is contained in:
parent
08377f924e
commit
ff3e1c1cda
28
.github/workflows/bug-report-version.yml
vendored
28
.github/workflows/bug-report-version.yml
vendored
@ -25,26 +25,22 @@ jobs:
|
|||||||
const versionHeader = issueBody.match(/### Bloxstrap Version/);
|
const versionHeader = issueBody.match(/### Bloxstrap Version/);
|
||||||
const versionMatch = issueBody.match(/v\d+\.\d+\.\d+/);
|
const versionMatch = issueBody.match(/v\d+\.\d+\.\d+/);
|
||||||
const latestVersion = '${{ steps.read-version.outputs.version }}';
|
const latestVersion = '${{ steps.read-version.outputs.version }}';
|
||||||
|
|
||||||
if (versionHeader && !versionMatch) {
|
if (versionHeader && !versionMatch) {
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: 'Unable to find Bloxstrap version.'
|
body: 'Please specify the Bloxstrap version you are using.'
|
||||||
});
|
|
||||||
}
|
|
||||||
const issueVersion = versionMatch[0];
|
|
||||||
if (issueVersion !== latestVersion) {
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: `You are using an outdated version of Bloxstrap (${issueVersion}). Please update to the [latest version of Bloxstrap](https://github.com/pizzaboxer/bloxstrap/releases/latest) (${latestVersion}).`
|
|
||||||
});
|
|
||||||
return github.rest.issues.update({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
state: 'closed'
|
|
||||||
});
|
});
|
||||||
|
} else if (versionMatch) {
|
||||||
|
const issueVersion = versionMatch[0];
|
||||||
|
if (issueVersion !== latestVersion) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: `You are using an outdated version of Bloxstrap (${issueVersion}). Please update to the [latest version of Bloxstrap](https://github.com/pizzaboxer/bloxstrap/releases/latest) (${latestVersion}).`
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user