Skip to content

Commit

Permalink
Fix workflow execution error
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallGaoX authored Sep 26, 2024
1 parent 5efb5a5 commit eb7e3a2
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,15 @@ jobs:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- id: fileschanged
run: |
case '${{ github.event_name }}' in
push)
firstCommit='${{ github.event.commits[0].id }}'
lastCommit='${{ github.event.commits[-1].id }}'
;;
pull_request)
firstCommit='${{ github.event.pull_request.base.sha }}'
lastCommit='${{ github.event.pull_request.head.sha }}'
;;
esac
firstCommit='${{ github.event.before }}'
lastCommit='${{ github.event.after }}'
changedFiles=$(git diff --name-only --diff-filter=d "${firstCommit}" "${lastCommit}")
echo "Files changed: $changedFiles"
NON_MD_FILES=$(echo "$changedFiles" | grep -v '\.md$' || true)
if [ -n "$NON_MD_FILES" ]; then
echo "non_doc_files_changed=true" >> $GITHUB_ENV
echo "non_doc_files_changed=true" >> $GITHUB_OUTPUT
else
echo "non_doc_files_changed=false" >> $GITHUB_ENV
echo "non_doc_files_changed=false" >> $GITHUB_OUTPUT
fi
ci:
name: CI
Expand Down

0 comments on commit eb7e3a2

Please sign in to comment.