Skip to content

Commit

Permalink
chore: Update workflow to label issue rather than close
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertByrnes committed Jul 8, 2024
1 parent 04123ce commit ba7b811
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/issue_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
with:
script: |
const { issue } = context.payload;
const requiredFields = ['Description', 'Steps to Reproduce', 'Expected Behavior', 'Actual Behavior', 'Environment'];
const requiredFields = ['Description', 'Steps to Reproduce', 'Expected Behavior', 'Actual Behavior', 'Environment', 'IDE'];
let missingFields = requiredFields.filter(field => !issue.body.includes(`### ${field}`));
if (missingFields.length > 0) {
const commentBody = `The following fields are missing: ${missingFields.join(', ')}`;
const commentBody = `The following fields are missing: ${missingFields.join(', ')}. Please update the issue with this information.`;
await github.issues.createComment({
...context.repo,
issue_number: issue.number,
body: commentBody
});
await github.issues.update({
await github.issues.addLabels({
...context.repo,
issue_number: issue.number,
state: 'closed'
labels: ['lacking information']
});
}

0 comments on commit ba7b811

Please sign in to comment.