-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.14 KB
/
remove-test-releases.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
name: Remove Test Releases
on:
workflow_dispatch:
schedule:
- cron: 0 2 * * 1
env:
GIT_USER: "svc-dot-bot"
GIT_EMAIL: "[email protected]"
jobs:
remove:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Config git
run: |
git config --global user.name "${{ env.GIT_USER }}"
git config --global user.email "${{ env.GIT_EMAIL }}"
- name: Checkout to gh-pages
run: |
git fetch
git checkout gh-pages
- name: remove test charts in index file
run: |
cat << EOF > index.yaml
apiVersion: v1
entries:
usage-engine-private-edition:
generated: "2023-02-27T14:54:15.008712628Z"
EOF
git commit -am "clean up test charts"
git push origin gh-pages
- name: Remove test releases
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release list --limit 1000 |
awk '{print $1}' |
xargs -I% gh release delete --yes --cleanup-tag %