This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
56 lines (51 loc) · 2.24 KB
/
translation-delete.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
name: Delete Translation
permissions:
actions: write
checks: write
contents: write
deployments: write
pull-requests: write
statuses: write
on:
workflow_run:
workflows: ["Pre-delete Translation"]
types:
- completed
env:
BRANCH: ${{ github.event.workflow_run.head_branch }}
jobs:
delete-translation:
if: |
(startsWith(github.event.workflow_run.head_branch, 'translation') || startsWith(github.event.workflow_run.head_branch, 'stp')) &&
!contains(github.event.workflow_run.head_branch, '!') &&
!contains(github.event.workflow_run.head_branch, '@') &&
!contains(github.event.workflow_run.head_branch, '#') &&
!contains(github.event.workflow_run.head_branch, '$') &&
!contains(github.event.workflow_run.head_branch, '%') &&
!contains(github.event.workflow_run.head_branch, '^') &&
!contains(github.event.workflow_run.head_branch, '&') &&
!contains(github.event.workflow_run.head_branch, '*') &&
!contains(github.event.workflow_run.head_branch, '(') &&
!contains(github.event.workflow_run.head_branch, ')')
runs-on: ubuntu-latest
steps:
- name: 'Branch [${{ github.event.workflow_run.head_branch }}]'
run: |
CLEAN_BRANCH="${BRANCH//[^[:alnum:]-_]/}"
echo "Deleting Translation Branch $CLEAN_BRANCH"
- name: Checkout 🛎️
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch }}
repository: ${{github.event.workflow_run.head_repository.full_name}}
- name: Setup Node
uses: actions/[email protected]
with:
node-version: '18.x'
- name: Installing Crowdin
run: npm i -g @crowdin/[email protected]
- name: Delete Branch [${{ github.event.workflow_run.head_branch }}] 🗑️
run: |
CLEAN_BRANCH="${BRANCH//[^[:alnum:]-_]/}"
crowdin branch delete $CLEAN_BRANCH -T ${{ secrets.CROWDIN_API_KEY }}