File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 4848 with :
4949 ref : ${{ github.event.pull_request.head.sha }}
5050
51+ - name : Get changed files
52+ if : github.event_name == 'pull_request_target'
53+ id : changed-files
54+ uses : tj-actions/changed-files@v45
55+ with :
56+ separator : " \n "
57+
58+ - name : Generate incremental licenserc
59+ if : github.event_name == 'pull_request_target' && steps.changed-files.outputs.all_changed_files != ''
60+ env :
61+ CHANGED_FILES : ${{ steps.changed-files.outputs.all_changed_files }}
62+ run : |
63+ python3 - <<'EOF'
64+ import yaml, os
65+
66+ with open('.licenserc.yaml') as f:
67+ config = yaml.safe_load(f)
68+
69+ changed = os.environ.get('CHANGED_FILES', '').strip().split('\n')
70+ changed = [p.strip() for p in changed if p.strip()]
71+
72+ config['header']['paths'] = changed
73+
74+ with open('.licenserc-incremental.yaml', 'w') as f:
75+ yaml.dump(config, f, default_flow_style=False, allow_unicode=True)
76+ EOF
77+
5178 - name : Check License
52- uses : apache/skywalking-eyes@v0.2.0
79+ if : github.event_name != 'pull_request_target' || steps.changed-files.outputs.all_changed_files != ''
80+ uses : apache/skywalking-eyes@v0.8.0
5381 env :
5482 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83+ with :
84+ config : ${{ github.event_name == 'pull_request_target' && '.licenserc-incremental.yaml' || '.licenserc.yaml' }}
You can’t perform that action at this time.
0 commit comments