-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (52 loc) · 1.89 KB
/
sync-helm-chart.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
on:
workflow_dispatch:
push:
paths:
- 'charts/gatekeeper/**'
branches:
- 'master'
tags:
- 'v*'
jobs:
sync-chart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.13.0
- run: |
git config --global user.email "[email protected]"
git config --global user.name "ks-ci-bot"
git clone --depth 1 [email protected]:ks-ci-bot/ks-extensions.git -b main
pushd ks-extensions
git remote add upstream [email protected]:kubesphere-extensions/ks-extensions.git
git fetch upstream main
git checkout -b sync/gatekeeper/${GITHUB_REF#refs/*/} upstream/main
popd
rm -rf ks-extensions/gatekeeper
OUTPUT=ks-extensions/gatekeeper make package
pushd ks-extensions
git add .
git commit -m "update gatekeeper helm chart"
git push origin sync/gatekeeper/${GITHUB_REF#refs/*/} --force
- env:
GH_TOKEN: ${{ secrets.CIBOT_ACCESS_TOKEN }}
run: |
pushd ks-extensions
if [[ $(gh pr ls -R kubesphere-extensions/ks-extensions -A ks-ci-bot -H sync/gatekeeper/${GITHUB_REF#refs/*/} -B main) == "" ]]; then
# Create a PR in the kubesphere-extensions/ks-extensions repository
gh pr create -R kubesphere-extensions/ks-extensions \
-B main \
-H ks-ci-bot:sync/gatekeeper/${GITHUB_REF#refs/*/} \
-t "Update gatekeeper extension from ${GITHUB_REF#refs/*/}" \
-b "Update gatekeeper extension"
fi