Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/license-eyes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,29 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Fetch base branch for diff
if: github.event_name == 'pull_request_target'
Comment thread
hello-stephen marked this conversation as resolved.
run: git fetch --no-tags --depth=1 origin ${{ github.base_ref }}

- name: Get changed files
if: github.event_name == 'pull_request_target'
id: changed-files
uses: tj-actions/changed-files@v45
with:
separator: "\n"
run: |
git diff --name-only FETCH_HEAD...HEAD | grep -qxF '.licenserc.yaml' \
&& echo "licenserc_changed=true" >> "$GITHUB_OUTPUT" || true
{
echo "added_modified<<EOF"
git diff --name-only --diff-filter=ACMR FETCH_HEAD...HEAD
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Generate incremental licenserc
if: github.event_name == 'pull_request_target' && steps.changed-files.outputs.all_changed_files != ''
if: >-
github.event_name == 'pull_request_target' &&
steps.changed-files.outputs.added_modified != '' &&
steps.changed-files.outputs.licenserc_changed != 'true'
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified }}
run: |
python3 - <<'EOF'
import yaml, os
Expand All @@ -76,9 +88,12 @@ jobs:
EOF

- name: Check License
if: github.event_name != 'pull_request_target' || steps.changed-files.outputs.all_changed_files != ''
if: >-
github.event_name != 'pull_request_target' ||
steps.changed-files.outputs.added_modified != '' ||
steps.changed-files.outputs.licenserc_changed == 'true'
uses: apache/skywalking-eyes@v0.8.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config: ${{ github.event_name == 'pull_request_target' && '.licenserc-incremental.yaml' || '.licenserc.yaml' }}
config: ${{ steps.changed-files.outputs.licenserc_changed == 'true' && '.licenserc.yaml' || (github.event_name == 'pull_request_target' && '.licenserc-incremental.yaml' || '.licenserc.yaml') }}
Loading