-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (52 loc) · 2.15 KB
/
draft-image-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Draft Image Release
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
types: [opened, reopened, edited, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
if: ${{ (github.event_name == 'pull_request') || !contains(github.event.head_commit.message, 'Bump Helm chart versions') }}
name: Autolabeler and release drafter
permissions:
# Write permission is required to create a GitHub release
contents: write
# Write permission is required for autolabeler
# Otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Command `gh pr edit` needs to run in a repository,
# so fetch a single file to make next step succeed
- name: Checkout GitHub Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: github.event_name == 'pull_request'
with:
sparse-checkout: |
README.md
sparse-checkout-cone-mode: false
- name: Remove labels in preparation for autolabeler
if: github.event_name == 'pull_request'
run: |
gh pr edit ${{ github.event.number }} \
--remove-label "Release/break,Release/feat,Release/fix,Release/other"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Drafts your next Release notes as Pull Requests are merged into "main"
- name: Release drafter
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
id: draft-image-release
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
with:
# To achive consistent results with different branches
# Source: https://github.com/release-drafter/release-drafter/issues/1061#issuecomment-1032888355
commitish: "${{ github.ref_name }}"
config-name: draft-image-release-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}