mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Auto-put PRs from release workflows in the proper milestone + minor things (#4862)
* Make workflow name use TitleCase * Indicate in the PR description that it's a multi-part workflow * Auto-put PRs from Prepare Release workflow in the proper milestone * Rename "Publish the release" workflow to "Publish Release" * Auto-put PR from Publish Release workflow in the proper milestone
This commit is contained in:
2
.github/workflows/scripts/bump_version.py
vendored
2
.github/workflows/scripts/bump_version.py
vendored
@@ -12,6 +12,8 @@ version_info = None
|
||||
def repl(match: Match[str]) -> str:
|
||||
global version_info
|
||||
|
||||
print(f"::set-output name=old_version::{match.group('version')}")
|
||||
|
||||
new_stable_version = os.environ.get("NEW_STABLE_VERSION", "auto")
|
||||
if new_stable_version == "auto":
|
||||
version_info = redbot.VersionInfo.from_str(match.group("version"))
|
||||
|
||||
49
.github/workflows/scripts/get_milestone_number_by_exact_title.js
vendored
Normal file
49
.github/workflows/scripts/get_milestone_number_by_exact_title.js
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
module.exports = (async function ({github, context}) {
|
||||
const milestone_title = process.env.MILESTONE_TITLE;
|
||||
const [repo_owner, repo_name] = process.env.GITHUB_REPOSITORY.split('/');
|
||||
|
||||
const {
|
||||
repository: {
|
||||
milestones: {
|
||||
nodes: milestones,
|
||||
pageInfo: {hasNextPage}
|
||||
}
|
||||
}
|
||||
} = await github.graphql({
|
||||
query: `
|
||||
query getMilestoneNumberByTitle(
|
||||
$repo_owner: String!
|
||||
$repo_name: String!
|
||||
$milestone_title: String!
|
||||
) {
|
||||
repository(owner:$repo_owner name:$repo_name) {
|
||||
milestones(query:$milestone_title states:OPEN first:100) {
|
||||
nodes {
|
||||
number
|
||||
title
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
repo_owner: repo_owner,
|
||||
repo_name: repo_name,
|
||||
milestone_title: milestone_title,
|
||||
});
|
||||
|
||||
if (hasNextPage) {
|
||||
// this should realistically never happen so let's just error
|
||||
core.setFailed('Impossible happened! :)');
|
||||
return;
|
||||
}
|
||||
|
||||
for (const milestone of milestones)
|
||||
if (milestone.title === milestone_title)
|
||||
return milestone.number;
|
||||
|
||||
// if no exact match is found, assume the milestone doesn't exist
|
||||
console.log('The milestone was not found. API returned the array: %o', milestones);
|
||||
return null;
|
||||
})
|
||||
Reference in New Issue
Block a user