Skip to content

[Release 3.0] Update gradle to 8.10.2 for JDK23 and codecov to v5 and fix delete backport branches #56

[Release 3.0] Update gradle to 8.10.2 for JDK23 and codecov to v5 and fix delete backport branches

[Release 3.0] Update gradle to 8.10.2 for JDK23 and codecov to v5 and fix delete backport branches #56

name: Check Workflow Events
on:
pull_request:
jobs:
check-workflow-events:
runs-on: ubuntu-latest
name: Check Workflow Events
steps:
- uses: actions/checkout@v4
- name: Check Workflow Events
working-directory: .github/workflows
run: |
set +e
EVENT_COUNT=0
for file_found in `ls | grep .ym`; do
yq -r e '.on | keys | .[0]' $file_found | grep -q pull_request_target
EVENT_FOUND=$?
if [ "$EVENT_FOUND" = 0 ] && [ "$file_found" != "backport.yml" ] && [ "$file_found" != "copy-linked-issue-labels.yml" ]; then
EVENT_COUNT=$(( EVENT_COUNT+1 ))
echo "'$file_found' workflow file contains 'pull_request_target' event, please remove!"
fi
done
if [ "$EVENT_COUNT" != 0 ]; then
exit 1
fi