1
1
name : Check License and History
2
2
3
- on : # this workflow is planned to be called by the ci_pipeline and it will compare the PR files with the main
3
+ on :
4
4
workflow_call :
5
5
workflow_dispatch :
6
6
push :
@@ -17,27 +17,23 @@ jobs:
17
17
uses : actions/checkout@v3
18
18
with :
19
19
fetch-depth : 0
20
+ ref : ${{ github.event.pull_request.head.sha }}
20
21
- name : Get changed files
21
22
id : changes
22
23
run : |
23
- echo ${{github.event.pull_request.head.repo.full_name}}
24
- if [ "${{ github.event.pull_request.head.repo.full_name }}" == "speedb-io/speedb" ]; then
25
- echo "files added or changed in a PR that came from the speedb repo: "
26
- git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- . ':!.github' ':!*.md'
27
- echo "diff_list<<EOF" >> $GITHUB_OUTPUT
28
- git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- . ':!.github' ':!*.md' >> $GITHUB_OUTPUT
29
- git diff --name-only --diff-filter=ACMRT remotes/origin/main HEAD -- . ':!.github' ':!*.md' >> $GITHUB_OUTPUT
30
- echo "EOF" >> $GITHUB_OUTPUT
31
- else
32
- echo "added or changed files: "
33
- git diff --name-only --diff-filter=ACMRT remotes/origin/main HEAD -- . ':!.github' ':!*.md'
34
- echo "diff_list<<EOF" >> $GITHUB_OUTPUT
35
- git diff --name-only --diff-filter=ACMRT remotes/origin/main HEAD -- . ':!.github' ':!*.md' >> $GITHUB_OUTPUT
36
- echo "EOF" >> $GITHUB_OUTPUT
37
- fi
24
+ echo "files added or changed in a PR: "
25
+ git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- . ':!.github' ':!*.md'
26
+ echo "added or changed files: "
27
+ git diff --name-only --diff-filter=ACMRT remotes/origin/main HEAD -- . ':!.github' ':!*.md'
28
+ echo "diff_list<<EOF" >> $GITHUB_OUTPUT
29
+ git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- . ':!.github' ':!*.md' >> $GITHUB_OUTPUT
30
+ git diff --name-only --diff-filter=ACMRT remotes/origin/main HEAD -- . ':!.github' ':!*.md' >> $GITHUB_OUTPUT
31
+ echo "EOF" >> $GITHUB_OUTPUT
32
+
38
33
- name : list new files
39
34
run : |
40
35
echo "New files in this PR ${{ steps.changes.outputs.diff_list }}"
36
+
41
37
lint :
42
38
runs-on : ubuntu-latest
43
39
needs : changedfiles
48
44
uses : actions/checkout@v3
49
45
with :
50
46
fetch-depth : 0
47
+ ref : ${{ github.event.pull_request.head.sha }}
51
48
- name : Check License
52
49
run : |
53
50
exit_code=0
59
56
done
60
57
exit $exit_code
61
58
- name : Check HISTORY PR
62
- if : github.event.pull_request.head.repo.full_name == 'speedb-io/speedb'
63
59
run : |
64
60
set +e
65
61
git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}|grep -v "\.github" |grep -q [a-z,A-Z]
91
87
exit $history_not_in
92
88
fi
93
89
echo "No files were added"
94
- exit 0
90
+ exit 0
0 commit comments