-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
55 lines (49 loc) · 1.89 KB
/
action.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: "AccessDB Diff"
description: "Generate diffs for accessdb files"
outputs:
has-accdb-files:
description: "True if accdb files were found"
value: ${{ steps.list-accdb-files.outputs.has-accdb-files }}
accdb-diffs:
description: "Text of accdb diff"
value: ${{ steps.generate-accdb-diff.outputs.accdb-diffs }}
runs:
using: "composite"
steps:
- id: list-accdb-files
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
run: |
added=$(${{ github.action_path }}/list-accdb-files.sh ${{ github.event.pull_request.head.sha }} "A" )
modified=$(${{ github.action_path }}/list-accdb-files.sh ${{ github.event.pull_request.head.sha }} "M" )
result="$added $modified"
if [ -n "$result" ]
then
echo "HAS_ACCDB_FILES=true" >> $GITHUB_ENV
echo "::set-output name=has_accdb_files::true"
else
echo "HAS_ACCDB_FILES=false" >> $GITHUB_ENV
echo "::set-output name=has_accdb_files::false"
fi
echo "::debug::$result"
shell: bash
- id: install-mdbtools
run: |
sudo apt --assume-yes install mdbtools
shell: bash
- id: install-csvtojson
run: |
sudo npm i -g csvtojson
shell: bash
- id: generate-accdb-diff
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
WORKSPACE: ${{ github.workspace }}
run: |
echo "V: 024"
echo "::debug::$(${{ github.action_path }}/list-accdb-files.sh ${{ github.event.pull_request.head.sha }} "A" )"
echo "::debug::$(${{ github.action_path }}/list-accdb-files.sh ${{ github.event.pull_request.head.sha }} "M" )"
result=$(${{ github.action_path }}/diff-accdb-files.sh \
${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }})
echo "::set-output name=accdb-diffs::${result}"
shell: bash