File tree Expand file tree Collapse file tree 2 files changed +323
-240
lines changed Expand file tree Collapse file tree 2 files changed +323
-240
lines changed Original file line number Diff line number Diff line change 1+ name : " Add 3P License Warning to PR"
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - setup.py
7+
8+ # Cancel in progress workflows on pull_requests.
9+ # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+ cancel-in-progress : true
13+
14+ permissions :
15+ contents : read
16+ pull-requests : write
17+
18+ jobs :
19+ warning-message-3plicense :
20+ name : Add ⚠️ Warning about 3p license
21+ runs-on : ubuntu-latest
22+ if : ${{ success() }} && ${{ github.event.issue.pull_request }}
23+ steps :
24+ - run : |
25+ BODY_MSG=$(cat << EOF
26+ ⚠️ This PR changed **setup.py** file. ⚠️
27+ - PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in **setup.py**.
28+ - PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in **setup.py**.
29+ EOF
30+ )
31+ echo "BODY_MSG<<EOF" >> $GITHUB_ENV
32+ echo "$BODY_MSG" >> $GITHUB_ENV
33+ echo "EOF" >> $GITHUB_ENV
34+ - uses : actions/github-script@v6
35+ with :
36+ github-token : ${{ github.token }}
37+ script : |
38+ github.rest.issues.createComment({
39+ issue_number: context.issue.number,
40+ owner: context.repo.owner,
41+ repo: context.repo.repo,
42+ body: `${{ env.BODY_MSG }}`
43+ })
You can’t perform that action at this time.
0 commit comments