Skip to content

dont run skip-ci

dont run skip-ci #24

Workflow file for this run

name: Skip CI
jobs:
check-ci:
runs-on: ubuntu-latest
outputs:
skip_ci: ${{ steps.check-diff.outputs.skip_ci }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check diff from Pull Request
id: check-diff
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$'))
printf '%s\n' "${fileChangesArray[@]}"
for item in "${fileChangesArray[@]}"
do
if [[ ! " ${skipList[@]} " =~ " ${item} " ]]; then
#found an item that doesn't belong to the skip list.
exit 0
fi
done
echo "skip_ci=true" >> $GITHUB_OUTPUT
- name: test
run: echo ${{ env.skip_ci }}