github.star¶
Edit repository files under .github: issue template config, release note categories, labels and funding.
Edits are line-based, so comments and layout stay as they were. For
workflows, see gha; for CODEOWNERS, codeowners; for Dependabot,
dependabot.
load("@fleet//github.star", "issue_templates", "set_blank_issues", "add_contact_link", "add_release_category", "set_label", "set_funding")
| Function | What it does |
|---|---|
issue_templates |
Lists the repo's issue templates and forms. |
set_blank_issues |
Allows or disallows issues that don't use a template. |
add_contact_link |
Adds a contact link to the new-issue page, unless one with this URL exists. |
add_release_category |
Adds a category to the release notes GitHub generates, unless one with this title exists. |
set_label |
Adds or updates a label in a label sync file, such as .github/labels.yml. |
set_funding |
Sets a sponsor link in .github/FUNDING.yml, such as github: [acme]. |
issue_templates¶
Lists the repo's issue templates and forms.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of the Markdown templates and YAML forms in .github/ISSUE_TEMPLATE, without its config.yml.
Example
issue_templates(repo)
# returns [".github/ISSUE_TEMPLATE/bug.yml", ".github/ISSUE_TEMPLATE/feature.md"]
set_blank_issues¶
Allows or disallows issues that don't use a template.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
enabled |
Whether blank issues are allowed. |
Returns: True when the file changed. The config is created if needed.
Example
add_contact_link¶
Adds a contact link to the new-issue page, unless one with this URL exists.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
name |
The link's title. |
url |
Where it points. |
about |
The line shown under it. |
Returns: True when the file changed. The config is created if needed.
Example
add_contact_link(repo, "Security report", "https://github.com/acme/api/security/advisories/new", "Report a vulnerability privately.")
# returns True
Used in: github-repo-files
add_release_category¶
Adds a category to the release notes GitHub generates, unless one with this title exists.
Categories go in changelog.categories of .github/release.yml, which
is created if missing. GitHub uses the first category whose labels
match a pull request, so add catch-alls (labels: ["*"]) last.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
title |
The category heading, such as Security. |
labels |
The labels that put a pull request in it. |
Returns: True when the file changed.
Example
Used in: github-repo-files
set_label¶
Adds or updates a label in a label sync file, such as .github/labels.yml.
The file is a list of labels with name, color and description, as
used by label sync actions and by Probot Settings under labels:. An
existing label keeps its place and gets the new color and description,
keeping the quotes it was written with; a new label's color is quoted.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
name |
The label name. |
color |
The hex color without #, such as d73a4a. |
description |
The label description, or None to leave it. |
path |
The label file. |
Returns: True when the file changed. The file is created if needed.
Example
Used in: github-repo-files
set_funding¶
Sets a sponsor link in .github/FUNDING.yml, such as github: [acme].
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
platform |
The platform key, such as github, open_collective or custom. |
value |
The account, or a list of accounts or URLs. |
Returns: True when the file changed. The file is created if needed.
Example