Skip to content

Commit

Permalink
✨ Allow customizing "note provided" label
Browse files Browse the repository at this point in the history
It's under `labels` in the config. It is possible to opt out with
`null`:

  labels:
    fragment-provided: ~

Resolves #40
  • Loading branch information
webknjaz committed Sep 1, 2024
1 parent 8137318 commit 12a27ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exclude:
- pyup-bot

labels:
fragment-provided: change note detected # default: `bot:chronographer:provided`, disable with `~`
skip-changelog: skip news # default: `bot:chronographer:skip`

paths: # relative modified file paths that do or don't need changelog mention
Expand Down
8 changes: 6 additions & 2 deletions chronographer/event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ async def on_pr(event):
))

labels_config = repo_config.get('labels', {})
fragment_provided_label = labels_config.get(
'fragment-provided',
LABEL_PROVIDED,
)
repo_skip_label = labels_config.get('skip-changelog', LABEL_SKIP)

logger.info(
Expand Down Expand Up @@ -310,14 +314,14 @@ async def on_pr(event):
else 'absent',
)

if news_fragments_added:
if news_fragments_added and fragment_provided_label is not None:
labels_url = f'{pull_request["issue_url"]}/labels'
await gh_api.post(
labels_url,
preview_api_version='symmetra',
data={
'labels': [
LABEL_PROVIDED,
fragment_provided_label,
],
},
)
Expand Down

0 comments on commit 12a27ab

Please sign in to comment.