File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Branch Deleted
2
+ on : delete
3
+ env :
4
+ REPLICATED_CLI_VERSION : 0.40.1
5
+ REPLICATED_API_TOKEN : ${{ secrets.REPLICATED_API_TOKEN }}
6
+ REPLICATED_APP : ${{ secrets.REPLICATED_APP }}
7
+ jobs :
8
+ delete :
9
+ if : github.event.ref_type == 'branch'
10
+ runs-on : ubuntu-latest
11
+ continue-on-error : true
12
+ steps :
13
+ - name : Install Replicated CLI
14
+ run : |
15
+ curl -sL https://github.com/replicatedhq/replicated/releases/download/v${{ env.REPLICATED_CLI_VERSION }}/replicated_${{ env.REPLICATED_CLI_VERSION }}_linux_amd64.tar.gz -o replicated.tar.gz
16
+ tar xf replicated.tar.gz replicated && rm replicated.tar.gz
17
+ mv replicated /usr/local/bin/replicated
18
+
19
+ - name : Delete Replicated channel
20
+ run : |
21
+ CHANNEL_ID=$(replicated channel inspect ${{ github.event.ref }} \
22
+ | grep "ID:" \
23
+ | sed "s/ID://" \
24
+ | sed "s/ //g" || true)
25
+
26
+ if [ "${CHANNEL_ID}" = "" ]; then
27
+ echo "No channel found"
28
+ exit 0
29
+ fi
30
+
31
+ # Allowed to fail if customers on channel - this will need to be manually deleted
32
+ replicated channel rm "${CHANNEL_ID}" || true
You can’t perform that action at this time.
0 commit comments