Skip to content

Commit ec8d3f1

Browse files
authored
Merge pull request #27 from targoy-qti/targoy-qti-patch-1
Create copyright-license-checker-action.yml
2 parents 47c5deb + bb369ba commit ec8d3f1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run Copyright and License Check
2+
on:
3+
pull_request_target:
4+
types: [opened, synchronize]
5+
6+
jobs:
7+
copyright-license-detector:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout PR head
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0 # Full history so we can diff properly
14+
ref: ${{ github.event.pull_request.head.ref }}
15+
repository: ${{ github.event.pull_request.head.repo.full_name }}
16+
17+
- name: Add PR base repo as remote and fetch it
18+
run: |
19+
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git
20+
git fetch upstream
21+
22+
- name: Generate final patch between base and head
23+
run: |
24+
git diff upstream/${{ github.event.pull_request.base.ref }} > pr.patch
25+
head -n 100 pr.patch
26+
27+
- name: Run copyright/license detector
28+
uses: qualcomm/copyright-license-checker-action@main
29+
with:
30+
patch_file: pr.patch
31+
repo_name: ${{ github.repository }}

0 commit comments

Comments
 (0)