56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: Detect Unexpected EE Changes
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
check-copyright-and-ee-files:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Find Enterprise Copyright
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
|
|
workflow_file=$(grep -rnl "^name:[[:space:]]*Detect Unexpected EE Changes" .github/workflows/*.yml | head -n1)
|
|
echo "Detected workflow file: $workflow_file"
|
|
|
|
all_files=$(grep -r -F -l "This software is copyright Kong Inc. and its licensors." .)
|
|
|
|
# ignore this file
|
|
files=$(echo "$all_files" | grep -v "$workflow_file$" || true)
|
|
|
|
|
|
if [ -n "$files" ]; then
|
|
echo "Error: Enterprise copyright detected in the following files:"
|
|
echo "$files"
|
|
exit 1
|
|
else
|
|
echo "No enterprise copyright found."
|
|
fi
|
|
|
|
- name: Get changed EE files
|
|
id: changed-ee-files
|
|
uses: kong/changed-files@cd69b79ca4e2a1198064c5e6564cce68920df311 # main (node24)
|
|
with:
|
|
files: |
|
|
spec-ee/**
|
|
plugins-ee/**
|
|
kong/enterprise_edition/**
|
|
kong/plugins/*-advanced/**
|
|
changelog/**/*-ee/**
|
|
|
|
- name: Detect EE files
|
|
if: steps.changed-ee-files.outputs.any_changed == 'true'
|
|
run: |
|
|
echo "The following unexpected EE files were detected:"
|
|
echo "${{ steps.changed-ee-files.outputs.all_changed_files }}"
|
|
exit 1
|