Skip to content

Commit 2f2ba29

Browse files
Copilotdanroth27
andcommitted
Improve error handling and duplicate detection in docs issue workflow
Co-authored-by: danroth27 <[email protected]>
1 parent 2562304 commit 2f2ba29

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/create-docs-issue.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ jobs:
3232
const issueBody = context.payload.issue.body || '';
3333
3434
// Check if we've already created a docs issue for this breaking change
35-
// by looking for existing comments from the bot
35+
// by looking for existing comments with the specific marker text
3636
const comments = await github.rest.issues.listComments({
3737
owner: context.repo.owner,
3838
repo: context.repo.repo,
3939
issue_number: issueNumber
4040
});
4141
4242
const docsIssueAlreadyCreated = comments.data.some(comment =>
43-
comment.user.type === 'Bot' &&
4443
comment.body.includes('A documentation tracking issue has been created')
4544
);
4645
@@ -85,5 +84,11 @@ Please add documentation for this breaking change to the ASP.NET Core documentat
8584
});
8685
} catch (error) {
8786
console.error('Error creating docs issue:', error);
88-
core.setFailed(`Failed to create docs issue: ${error.message}`);
87+
// Check if error is due to missing token permissions
88+
if (error.status === 403 || error.status === 401) {
89+
throw new Error(`Failed to create docs issue due to insufficient permissions. Please ensure DOCS_ISSUE_TOKEN secret is configured with 'repo' scope. Error: ${error.message}`);
90+
}
91+
throw new Error(`Failed to create docs issue: ${error.message}`);
8992
}
93+
94+

0 commit comments

Comments
 (0)