-
Notifications
You must be signed in to change notification settings - Fork 588
56 lines (53 loc) · 2.02 KB
/
delete-catalog.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
name: Delete Cloud Native Catalog Items
on:
repository_dispatch:
types: [delete_catalog]
jobs:
UpdateCloudNativeCatalog:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Set env
run : |
echo "MESHERY_CLOUD_BASE_URL=https://meshery.layer5.io" >> $GITHUB_ENV
echo "MESHERY_CATALOG_FILES_DIR=catalog" >> $GITHUB_ENV
- name: Delete Catalog Patterns
run: |
patternType="${{ github.event.client_payload.type }}"
if [[ $patternType == "" ]]; then
patternType="Deployment"
fi
filename="${{ github.event.client_payload.pattern_id }}"
if [[ $filename != "" ]]; then
rm -f $MESHERY_CATALOG_FILES_DIR/$filename.yaml
rm -f ./collections/_catalog/"$(echo $patternType | tr '[:upper:]' '[:lower:]')"/$filename.md
else
echo "No patterns to delete"
fi
- name: Delete Catalog Filters
run: |
filterType="${{ github.event.client_payload.type }}"
if [[ $filterType == "" ]]; then
filterType="wasm filter"
fi
filename="${{ github.event.client_payload.filter_id }}"
if [[ $filename != "" ]]; then
rm -f $MESHERY_CATALOG_FILES_DIR/$filename.yaml
rm -f ./collections/_catalog/"$(echo $filterType | tr '[:upper:]' '[:lower:]')"/$filename.md
else
echo "No Filters to delete"
fi
- name: Pull changes from remote
run: git pull origin master
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: catalog/* collections/_catalog/*
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Catalog] Update Catalog items'