File tree 3 files changed +35
-29
lines changed
3 files changed +35
-29
lines changed Original file line number Diff line number Diff line change @@ -27,26 +27,32 @@ jobs:
27
27
# Build job
28
28
build :
29
29
runs-on : ubuntu-latest
30
- defaults :
31
- run :
32
- working-directory : react
33
30
steps :
34
31
- name : Checkout
35
32
uses : actions/checkout@v4
36
- with :
37
- sparse-checkout : react
33
+ with :
34
+ sparse-checkout : react
35
+ - name : Change Directory to React Folder
36
+ run : cd ./react/
37
+ - name : Check yarn.lock Exist
38
+ id : check_yarn
39
+ uses : thebinaryfelix/check-file-existence-action@v1
40
+ with :
41
+ files : ' yarn.lock'
42
+ - name : Check package.json Exist
43
+ id : check_package
44
+ uses : thebinaryfelix/check-file-existence-action@v1
45
+ with :
46
+ files : ' package.json'
38
47
- name : Detect package manager
39
48
id : detect-package-manager
40
-
41
- # Old-1: if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42
- # Old-2: elif [ -f "${{ github.workspace }}/package.json" ]; then
43
49
run : |
44
- if [ ${{ hashFiles('**/yarn.lock') != ' ' }} ] then
50
+ if ${{ steps.check_yarn.outputs.exists == 'true ' }} then
45
51
echo "manager=yarn" >> $GITHUB_OUTPUT
46
52
echo "command=install" >> $GITHUB_OUTPUT
47
53
echo "runner=yarn" >> $GITHUB_OUTPUT
48
54
exit 0
49
- elif [ ${{ hashFiles('**/package.json') != ' ' }} ] then
55
+ if ${{ steps.check_package.outputs.exists == 'true ' }} then
50
56
echo "manager=npm" >> $GITHUB_OUTPUT
51
57
echo "command=ci" >> $GITHUB_OUTPUT
52
58
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 30
30
build :
31
31
runs-on : ubuntu-latest
32
32
defaults :
33
- run :
33
+ run :
34
34
working-directory : react
35
35
steps :
36
36
- name : Checkout
89
89
# Deployment job
90
90
deploy :
91
91
defaults :
92
- run :
92
+ run :
93
93
working-directory : react
94
94
environment :
95
95
name : github-pages
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ name: Validate-YAML
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
paths : ['.github/**']
7
7
pull_request :
8
- branches : [ main ]
8
+ branches : [main]
9
9
paths : ['.github/**']
10
10
11
11
workflow_dispatch :
@@ -14,22 +14,22 @@ jobs:
14
14
validate-yaml :
15
15
runs-on : ubuntu-latest
16
16
steps :
17
- - name : Checkout
18
- uses : actions/checkout@v4
19
- with :
20
- sparse-checkout : .github
17
+ - name : Checkout
18
+ uses : actions/checkout@v4
19
+ with :
20
+ sparse-checkout : .github
21
21
22
- - name : Validate YAML files
23
- id : lint
24
- uses : ibiqlik/action-yamllint@v3
22
+ - name : Validate YAML files
23
+ id : lint
24
+ uses : ibiqlik/action-yamllint@v3
25
25
26
- - name : Echo Lint Result
27
- if : always()
28
- run : echo ${{ steps.lint.outputs.logfile }}
26
+ - name : Echo Lint Result
27
+ if : always()
28
+ run : echo ${{ steps.lint.outputs.logfile }}
29
29
30
- - name : Output Logfile
31
- uses : actions/upload-artifact@v4
32
- if : always()
33
- with :
30
+ - name : Output Logfile
31
+ uses : actions/upload-artifact@v4
32
+ if : always()
33
+ with :
34
34
name : yamllint-logfile
35
- path : ${{ steps.lint.outputs.logfile }}
35
+ path : ${{ steps.lint.outputs.logfile }}
You can’t perform that action at this time.
0 commit comments