2024-05-30 16:50:06 +03:00
---
2024-05-31 17:11:36 +03:00
name : Changelog automation
2024-05-30 16:50:06 +03:00
on :
pull_request_target :
2024-06-06 17:16:36 +03:00
types : [ opened, edited]
2024-05-30 16:50:06 +03:00
permissions :
contents : read # the config file
pull-requests: write # for labeling pull requests (on: pull_request_target or on : pull_request)
statuses : write # to generate status
checks : write # to generate status
jobs :
2024-05-31 17:11:36 +03:00
changelog-automation :
name : Changelog automation
2024-05-31 16:37:10 +03:00
runs-on : ubuntu-latest
steps :
2024-05-31 17:11:36 +03:00
- name : Remove old PR labels
uses : mondeja/remove-labels-gh-action@v2.0.0
2024-05-31 16:37:10 +03:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
labels : |
kind/BUGFIX
kind/ENHANCEMENT
kind/FEATURE
kind/CHANGE
release-note-none
2024-05-31 17:11:36 +03:00
- name : Add label to PR
2024-05-30 16:50:06 +03:00
id : labeler
uses : jimschubert/labeler-action@v1
with :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
# Adjust the configuration in /.github/labeler.yml
- name : Verify Label
id : preview_label_check
uses : docker://agilepathway/pull-request-label-checker:latest
with :
any_of : kind/BUGFIX,kind/ENHANCEMENT,kind/FEATURE,kind/CHANGE,release-note-none
repo_token : ${{ secrets.GITHUB_TOKEN }}
allow_failure : true
- name : Comment on Label Check Failure
uses : thollander/actions-comment-pull-request@v2.5.0
if : steps.preview_label_check.outputs.label_check == 'failure'
with :
message : |
2024-05-31 17:11:36 +03:00
PR body does not contain a valid type of change. Please refer to [CONTRIBUTING.md](https://github.com/prometheus/client_golang/blob/main/CONTRIBUTING.md#how-to-write-a-pr-description) for more information.
2024-05-30 16:50:06 +03:00
comment_tag : labelfailure
mode : recreate
- name : Remove Label Check Failure Comment
uses : thollander/actions-comment-pull-request@v2.5.0
if : steps.preview_label_check.outputs.label_check == 'success'
with :
message : |
PR body contains a valid type of change.
comment_tag : labelfailure
mode : delete
create_if_not_exists : false
- name : Exit on Failure
if : steps.preview_label_check.outputs.label_check == 'failure'
run : exit 1