feat: scanning pr for review - github action #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Artwork | |
on: | |
pull_request: | |
paths: | |
- 'art/**' | |
jobs: | |
check-artwork: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch main branch | |
run: git fetch origin main | |
- name: Get new directories | |
id: new_dirs | |
run: | | |
NEW_DIRS=$(git diff --name-only --diff-filter=A origin/main | grep '^art/' | xargs -I{} dirname {} | sort -u | tr '\n' ' ') | |
echo "new_dirs=$NEW_DIRS" >> $GITHUB_ENV | |
echo "New directories: $new_dirs" | |
- name: Run artwork checks | |
run: | | |
for dir in $NEW_DIRS; do | |
node .github/workflows/check_artwork.cjs "$dir" | |
done | |
env: | |
NEW_DIRS: ${{ env.new_dirs }} |