-
Notifications
You must be signed in to change notification settings - Fork 37
62 lines (50 loc) · 1.59 KB
/
fixer.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
57
58
59
60
61
62
name: Fix Sub Ouput
on:
push:
paths:
- 'python/replace.py'
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
jobs:
update-file:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch content from URL and update file
run: |
# Fetch content from URL
curl -L "${{ secrets.INPUT_URL }}" | base64 --decode > ./sub
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Run Replace
run: |
python python/replace.py
- name: Commit Sub
run: |
git config --local user.email "action@github.com"
git config --local user.name "Github Action"
git add -A
git diff --quiet && get diff -staged --quiet || git commit -m "Fix Sub"
git push
- name: Run Pretest
run: |
python python/pretest.py
- name: Convert Sub to Base64
run: |
content=$(cat sub | base64 | tr -d '\n')
echo "$content" > sub64
- name: Convert Pretest to Base64
run: |
content=$(cat python/pretest | base64 | tr -d '\n')
echo "$content" > python/pretest64
- name: Commit Base64 Changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "Github Action"
git add -A
git diff --quiet && get diff -staged --quiet || git commit -m "Convert to Base64"
git push