-
Notifications
You must be signed in to change notification settings - Fork 274
52 lines (49 loc) · 1.77 KB
/
check-entities.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
name: Check DB Entities
on: [pull_request]
jobs:
check-db-entities:
name: Check DB Entities
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- name: Find touched DB Entities
id: touchedEntities
continue-on-error: true
run: |
status=$(grep '@Entity' -rinl . | xargs -r git diff-index --name-only --exit-code --output=touchedEntities origin/${{ github.base_ref }} $(); echo $?)
output=$(cat touchedEntities)
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
echo $output
echo ::set-output name=touchedEntities::$output
exit $status
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
if: steps.touchedEntities.outcome == 'failure'
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: DB Entities have been updated. Do we need to upgrade DB Version?
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
if: steps.touchedEntities.outcome == 'failure'
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
DB Entities have been updated. Do we need to upgrade DB Version?
Modified Entities :
```
${{ steps.touchedEntities.outputs.touchedEntities }}
```
edit-mode: replace