-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (46 loc) · 1.79 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
name: Draft Image Release
on:
push:
branches:
- main
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 version and update docs') }}
name: Autolabeler and release drafter
permissions:
contents: write
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" \
|| exit 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}