-
Notifications
You must be signed in to change notification settings - Fork 24
95 lines (84 loc) · 2.84 KB
/
release_please.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GH_CQ_BOT }}
- name: Checkout
uses: actions/checkout@v4
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
with:
fetch-depth: 0
- name: Configure Git
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
uses: azure/setup-helm@v4
with:
version: v3.8.1
- name: Helm Deps
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
run: |
helm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
uses: helm/[email protected]
with:
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Get PR data
uses: actions/github-script@v7
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
id: get_pr_data
with:
script: |
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
- name: Update PR labels
uses: actions/github-script@v7
if: |
startsWith(github.event.head_commit.message, 'chore(main): Release')
with:
script: |
const prNumber = ${{ fromJson(steps.get_pr_data.outputs.result).number }};
// Remove the pending label
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
name: 'autorelease: pending'
});
// Add the tagged label
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['autorelease: tagged']
});