Skip to content

Ref: Skip CI for commits without code changes #10

Ref: Skip CI for commits without code changes

Ref: Skip CI for commits without code changes #10

Workflow file for this run

name: Skip CI
on: [push, pull_request]
jobs:
check-ci:
runs-on: ubuntu-latest
steps:
- name: Check diff from
run: |
skipList=(".github/codeowners")
# Ignores changelog.md, readme.md,...
fileChangesArray=($(git diff --name-only origin/${{ github.base_ref }}..origin/${{ github.head_ref }} | grep -v '\.md$'))
echo git diff --name-only HEAD~ HEAD
for item in "${fileChangesArray[@]}"
do
if [[ ! " ${my_array[@]} " =~ " ${item} " ]]; then
echo "{skip_ci}=true >> $GITHUB_ENV"
exit 1
fi
done
echo "{skip_ci}=false >> $GITHUB_ENV"