forked from knative/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (80 loc) · 3.16 KB
/
publish-helm.yaml
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
96
97
98
99
100
101
102
name: Publish Helm Charts
on:
release:
types: [published]
jobs:
release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v4
- name: Install Helm HTML Plugin
run: helm plugin install https://github.com/halkeye/helm-repo-html
- name: Build Helm Chart Repo index.yaml
run: |
# this script from main will be gone on gh-pages branch,
# so lets stash it away in a temp directory in the directory above this one
mkdir ../.tmp
mv hack/find_helm_chart_releases_and_create_helm_index.sh ../.tmp/
mv hack/gh-pages.tmpl ../.tmp/
PAGES_BRANCH="gh-pages"
git fetch --all --tags
if git show-ref --verify --quiet refs/heads/$PAGES_BRANCH || git ls-remote --exit-code --heads origin $PAGES_BRANCH; then
# Branch exists
git checkout $PAGES_BRANCH
echo "Checked out existing branch '$PAGES_BRANCH'"
else
# Branch does not exist
git symbolic-ref HEAD refs/heads/$PAGES_BRANCH
rm .git/index
git clean -fdx
echo ".tmp/" > .gitignore
echo "Created and checked out new branch '$PAGES_BRANCH'"
fi
mv ../.tmp ./
.tmp/find_helm_chart_releases_and_create_helm_index.sh
helm repo-html -t .tmp/gh-pages.tmpl
if output=$(git status --porcelain) && [ -z "$output" ]; then
# Working directory clean
echo "No changes to commit"
else
# Uncommitted changes
echo "Changes detected"
git status
echo "Committing..."
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "update helm chart repository index"
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: feat/update-helm-repo-index-${{ github.sha }}
base: gh-pages
title: Update Helm Chart Repository Index
body: |
<!--
Are you using Knative? If you do, we would love to know!
https://github.com/knative/community/issues/new?template=ADOPTERS.yaml&title=%5BADOPTERS%5D%3A+%24%7BCOMPANY+NAME+HERE%7D
-->
<!--
Request Prow to automatically lint any go code in this PR:
/lint
-->
## Proposed Changes
* Update Helm Chart Repository Index - generated by the publish-helm.yaml workflow
**Release Note**
<!-- Enter your extended release note in the below block. If the PR requires
additional action from users switching to the new release, include the string
"action required". If no release note is required, write "NONE". -->
```release-note
NONE
```