Skip to content

Commit

Permalink
Improve release PR instructions & tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Apr 2, 2024
1 parent 0d2b2be commit 579b68d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stage-1/create-release-pr/create-release-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {escSQ, execSync, curlOpts} = require('cylc-action-utils');
// WARNING: Don't use ${env.GITHUB_TOKEN} in execSync() as that might print in log. Use `$GITHUB_TOKEN` instead.

if (!env.VERSION) {
throw "::error:: Environment variable `VERSION` not set";
throw "::error::Environment variable `VERSION` not set";
}

const repoURL = `https://github.com/${env.GITHUB_REPOSITORY}`;
Expand Down Expand Up @@ -50,7 +50,7 @@ const bodyText = `
This PR was created by the \`${env.GITHUB_WORKFLOW}\` workflow, triggered by @${author}
#### Tests:
${workflowBadges ? `- Tests last run on \`${env.BASE_REF}\`: ${workflowBadges.join(' ')}` : ''}
${workflowBadges ? `- Tests last run on \`${env.BASE_REF}\`:\n ${workflowBadges.join('\n ')}` : ''}
- ✔️ Build check passed - see the [workflow run](${repoURL}/actions?query=workflow%3A%22${encodeURIComponent(env.GITHUB_WORKFLOW)}%22) (number ${env.GITHUB_RUN_NUMBER}) for more info
#### Checklist:
Expand All @@ -63,6 +63,9 @@ ${workflowBadges ? `- Tests last run on \`${env.BASE_REF}\`: ${workflowBadges.jo
- @${author} should request 1 or 2 reviews
- If any further changes are needed, push to this PR branch
- After merging, the bot will comment below with a link to the release (if not, look at the PR checks tab)
> [!IMPORTANT]
> Do **not** use \`[skip ci]\` in commit messages pushed to this PR, as it will prevent the 2nd stage release workflow from running.
`;

const cmd = [
Expand Down Expand Up @@ -94,7 +97,7 @@ function getMilestone() {
try {
response = JSON.parse(execSync(request));
} catch (err) {
console.log(`::warning:: Error getting milestones`);
console.log(`::warning::Error getting milestones`);
console.log(err, '\n');
return;
}
Expand All @@ -104,7 +107,7 @@ function getMilestone() {
return milestone;
}
}
console.log(`::warning:: Could not find milestone matching "${env.VERSION}"`);
console.log(`::warning::Could not find milestone matching "${env.VERSION}"`);
return;
}

Expand Down

0 comments on commit 579b68d

Please sign in to comment.