Skip to content

Commit

Permalink
Fix note syntax in GitHub MD. (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist authored May 21, 2024
1 parent 6befe09 commit e063839
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 39 deletions.
30 changes: 15 additions & 15 deletions actions/status-checker/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion actions/status-checker/dist/index.js.map

Large diffs are not rendered by default.

37 changes: 19 additions & 18 deletions actions/status-checker/src/pull-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export async function tryUpdatePullRequestBody(token: string) {
allFiles = [...pullRequest.files.edges];

while (details.repository.pullRequest.files.pageInfo.hasNextPage) {
const cursor = details.repository.pullRequest.files.pageInfo.endCursor;
const cursor =
details.repository.pullRequest.files.pageInfo.endCursor;
details = await getPullRequest(token, cursor);

if (!details) {
Expand Down Expand Up @@ -119,20 +120,20 @@ async function getPullRequest(
cursor: string | null = null
): Promise<PullRequestDetails> {
/*
You can verify the query below, by running the following in the GraphQL Explorer:
https://docs.github.com/en/graphql/overview/explorer
1. Sign in to GitHub.
2. Paste the query string value into the query window.
3. Replace the $name, $owner, and $number variables with the values from your repository, or use the following JSON:
{
"name": "docs",
"owner": "dotnet",
"number": 36636,
"cursor": null
}
4. Click the "Play" button.
*/
You can verify the query below, by running the following in the GraphQL Explorer:
https://docs.github.com/en/graphql/overview/explorer
1. Sign in to GitHub.
2. Paste the query string value into the query window.
3. Replace the $name, $owner, and $number variables with the values from your repository, or use the following JSON:
{
"name": "docs",
"owner": "dotnet",
"number": 36636,
"cursor": null
}
4. Click the "Play" button.
*/

const octokit = getOctokit(token);
return await octokit.graphql<PullRequestDetails>({
Expand Down Expand Up @@ -229,9 +230,9 @@ function sortByChangeType(
return files.sort((a, b) => {
return descending
? changeTypeOrder.indexOf(b.changeType) -
changeTypeOrder.indexOf(a.changeType)
changeTypeOrder.indexOf(a.changeType)
: changeTypeOrder.indexOf(a.changeType) -
changeTypeOrder.indexOf(b.changeType);
changeTypeOrder.indexOf(b.changeType);
});
}

Expand Down Expand Up @@ -322,7 +323,7 @@ async function buildMarkdownPreviewTable(
}

if (exceedsMax /* include footnote when we're truncating... */) {
markdownTable += `\n> **Note**\n> This table shows preview links for the ${workflowInput.maxRowCount} files with the most changes. For preview links for other files in this PR, select <strong>OpenPublishing.Build Details</strong> within [checks](${checksUrl}).\n`;
markdownTable += `\n> [!NOTE]\n> This table shows preview links for the ${workflowInput.maxRowCount} files with the most changes. For preview links for other files in this PR, select <strong>OpenPublishing.Build Details</strong> within [checks](${checksUrl}).\n`;
}

return markdownTable;
Expand Down
11 changes: 7 additions & 4 deletions actions/status-checker/src/status-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export async function isSuccessStatus(token: string) {
// Didn't find OPS status. This is bad.
if (!buildStatus) {
setFailed(
`Did not find OPS status check after waiting for ${
(loops * 10) / 60
`Did not find OPS status check after waiting for ${(loops * 10) / 60
} minutes. If it shows 'Expected — Waiting for status to be reported', close and reopen the pull request to trigger a build.`
);
}
Expand Down Expand Up @@ -117,10 +116,14 @@ export async function isSuccessStatus(token: string) {
}
} else {
// Build status is error/failure.
setFailed("OpenPublishing.Build status is either failure or error.");
setFailed(
"OpenPublishing.Build status is either failure or error."
);
}
} else {
setFailed("Event is not a pull request or payload action is undefined.");
setFailed(
"Event is not a pull request or payload action is undefined."
);
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion actions/status-checker/src/types/WorkflowInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class WorkflowInput {
return new Map();
}

constructor() {}
constructor() { }
}

export const workflowInput: WorkflowInput = new WorkflowInput();

0 comments on commit e063839

Please sign in to comment.