Skip to content

Commit ec68b06

Browse files
committed
chore: README
1 parent 9ce2979 commit ec68b06

4 files changed

Lines changed: 74 additions & 0 deletions

File tree

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Access Database Diff Tool Action
2+
3+
This action generates JSON diffs for Access Database (accdb) files within the pull request.
4+
These diffs can then be used in other steps of your workflow to generate comments, or send alerts, etc.
5+
6+
## Usage/Examples
7+
8+
Here is an example workflow that integrates the `access-database-file-diff-action`
9+
to generate a `diff` comment for each Access Database file:
10+
11+
````yaml
12+
name: Generate Access Database diff comments
13+
14+
on:
15+
pull_request:
16+
workflow_dispatch:
17+
18+
jobs:
19+
process-access-files:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
diffs: ${{ steps.accdb-diff.outputs.accdb-diffs }}
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Generate Access Database file diffs
31+
id: accdb-diff
32+
uses: JacksonCougar/access-database-file-diff-action@main
33+
34+
create-comments:
35+
needs: process-access-files
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix: ${{ fromJson(needs.process-access-files.outputs.diffs) }}
39+
steps:
40+
- name: Generate comment
41+
id: add-comment
42+
env:
43+
comment: "```diff\n${{ matrix.files.text }}\n```"
44+
run: |
45+
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
46+
-X POST -d '{"path": ${{ toJson(matrix.files.name) }}, "position": 0, "body": ${{ toJson(env.comment) }}}' \
47+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments"
48+
````
49+
50+
There are two outputs returned by `access-database-file-diff-action`:
51+
`has-accdb-files`: `true` if Access Database files were found.
52+
`accdb-diffs`: a json object that contains the diff information of each Access Database file.
53+
The schema of the json object looks like this:
54+
55+
```json
56+
{
57+
files:
58+
[
59+
{
60+
name: string
61+
text: string
62+
},
63+
...
64+
]
65+
}
66+
```
67+
68+
69+
## Screenshots
70+
![](images/2021-09-13-07-56-49.png)
71+
72+
![](images/2021-09-13-07-55-45.png)
73+
74+
![](images/2021-09-13-07-54-38.png)

images/2021-09-13-07-54-38.png

83.3 KB
Loading

images/2021-09-13-07-55-45.png

44.7 KB
Loading

images/2021-09-13-07-56-49.png

51.9 KB
Loading

0 commit comments

Comments
 (0)