-
Notifications
You must be signed in to change notification settings - Fork 26
59 lines (49 loc) · 1.69 KB
/
chart-rebuild.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
name: Rebuild index.yaml manually
on:
workflow_dispatch:
jobs:
rebuild:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'gh-pages'
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.6.3
- name: Rebuild index.yaml
env:
version: v1.2.1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ ! -d "$RUNNER_TOOL_CACHE" ]]; then
echo "Cache directory '$RUNNER_TOOL_CACHE' does not exist" >&2
exit 1
fi
arch=$(uname -m)
cache_dir="$RUNNER_TOOL_CACHE/ct/$version/$arch"
if [[ ! -d "$cache_dir" ]]; then
mkdir -p "$cache_dir"
echo "Installing chart-releaser..."
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/$version/chart-releaser_${version#v}_linux_amd64.tar.gz"
tar -xzf cr.tar.gz -C "$cache_dir"
rm -f cr.tar.gz
echo 'Adding cr directory to PATH...'
export PATH="$cache_dir:$PATH"
fi
echo "Rebuilding index.yaml"
scripts/rebuild.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Rebuild index.yaml
title: Rebuild index.yaml
- name: Check outputs
run: |
echo "Created Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"