-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add maintainers and public roadmap (#1167)
* docs: added maintainers handbook page * docs: added maintainers handbook page * docs: update mkdocs & nav * docs: updated toc * chore: update gh-issue templates * docs: update notes about languages * docs: update label * chore: update stalebot + removed autoassign bot * chore: update labels in scripts * docs: updates to maintainers & labels * fix: label name * fix: label name * Update .github/stale.yml
- Loading branch information
1 parent
6f0c307
commit 36caa4e
Showing
23 changed files
with
652 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
const { LABEL_PENDING_RELEASE, LABEL_RELEASED } = require("./constants"); | ||
|
||
/** | ||
* Fetch issues using GitHub REST API | ||
* | ||
* @param {object} gh_client - Pre-authenticated REST client (Octokit) | ||
* @param {string} org - GitHub Organization | ||
* @param {string} repository - GitHub repository | ||
* @param {string} state - GitHub issue state (open, closed) | ||
* @param {string} label - Comma-separated issue labels to fetch | ||
* @return {Object[]} issues - Array of issues matching params | ||
* @see {@link https://octokit.github.io/rest.js/v18#usage|Octokit client} | ||
*/ | ||
|
||
const fetchIssues = async ({ | ||
gh_client, | ||
org, | ||
repository, | ||
state = "all", | ||
label = LABEL_PENDING_RELEASE, | ||
}) => { | ||
try { | ||
const { data: issues } = await gh_client.rest.issues.listForRepo({ | ||
owner: org, | ||
repo: repository, | ||
state: state, | ||
labels: label, | ||
}); | ||
|
||
return issues; | ||
} catch (error) { | ||
console.error(error); | ||
throw new Error("Failed to fetch issues"); | ||
} | ||
|
||
}; | ||
|
||
/** | ||
* Notify new release and close staged GitHub issue | ||
* | ||
* @param {object} gh_client - Pre-authenticated REST client (Octokit) | ||
* @param {string} owner - GitHub Organization | ||
* @param {string} repository - GitHub repository | ||
* @param {string} release_version - GitHub Release version | ||
* @see {@link https://octokit.github.io/rest.js/v18#usage|Octokit client} | ||
*/ | ||
|
||
const notifyRelease = async ({ | ||
gh_client, | ||
owner, | ||
repository, | ||
release_version, | ||
}) => { | ||
const release_url = `https://github.com/${owner}/${repository}/releases/tag/v${release_version}`; | ||
|
||
const issues = await fetchIssues({ | ||
gh_client: gh_client, | ||
org: owner, | ||
repository: repository, | ||
}); | ||
|
||
issues.forEach(async (issue) => { | ||
console.info(`Updating issue number ${issue.number}`); | ||
|
||
const comment = `This is now released under [${release_version}](${release_url}) version!`; | ||
try { | ||
await gh_client.rest.issues.createComment({ | ||
owner: owner, | ||
repo: repository, | ||
body: comment, | ||
issue_number: issue.number, | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
throw new Error(`Failed to update issue ${issue.number} about ${release_version} release`) | ||
} | ||
|
||
|
||
// Close issue and remove staged label; keep existing ones | ||
const labels = issue.labels | ||
.filter((label) => label.name != LABEL_PENDING_RELEASE) | ||
.map((label) => label.name); | ||
|
||
try { | ||
await gh_client.rest.issues.update({ | ||
repo: repository, | ||
owner: owner, | ||
issue_number: issue.number, | ||
state: "closed", | ||
labels: [...labels, LABEL_RELEASED], | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
throw new Error("Failed to close issue") | ||
} | ||
|
||
console.info(`Issue number ${issue.number} closed and updated`); | ||
}); | ||
}; | ||
|
||
// context: https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts | ||
|
||
module.exports = async ({ github, context }) => { | ||
const { RELEASE_VERSION } = process.env; | ||
console.log(`Running post-release script for ${RELEASE_VERSION} version`); | ||
|
||
await notifyRelease({ | ||
gh_client: github, | ||
owner: context.repo.owner, | ||
repository: context.repo.repo, | ||
release_version: RELEASE_VERSION, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.