File tree 1 file changed +13
-9
lines changed
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -11,25 +11,29 @@ jobs:
11
11
steps :
12
12
- name : Checkout
13
13
uses : actions/checkout@v2
14
+ - name : Configure Git
15
+ run : |
16
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
17
+ git config --global user.name "github-actions[bot]"
14
18
- name : Set up Python
15
19
uses : actions/setup-python@v2
16
20
with :
17
21
python-version : ' 3.x'
18
22
- name : Run Groovy Compiler
19
- shell : pwsh
20
23
run : |
21
24
# Find groovy files starts with _ on current directory
22
- $groovyFiles = Get-ChildItem -Path . -Filter "_*.groovy" -Recurse
25
+ groovyFiles=$(find . -type f -name "_*.groovy")
26
+
23
27
# Compile each groovy file
24
- foreach ($ file in $groovyFiles) {
25
- $ compiledFile = "compiled/$($file.Name -replace '^_',' ')"
26
- Write-Host "Compiling $($ file.FullName) to $compiledFile"
27
- python3 compiler.py $file.FullName $compiledFile
28
- }
28
+ for file in $groovyFiles; do
29
+ compiledFile= "compiled/$(basename " $file" | sed 's/^_// ')"
30
+ echo "Compiling $file to $compiledFile"
31
+ python3 compiler.py " $file" " $compiledFile"
32
+ done
29
33
- name : Commit and Push Changes
34
+ env :
35
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
36
run : |
31
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
32
- git config --global user.name "github-actions[bot]"
33
37
git add compiled
34
38
git commit -m "Compile Groovy Scripts"
35
39
git push
You can’t perform that action at this time.
0 commit comments