Add LuckYang1/PDF-to-md #56
Workflow file for this run
This file contains hidden or 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: Addon Tag Review | |
| on: | |
| pull_request: | |
| paths: | |
| - 'addons/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| review: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install Dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Determine addon files to review | |
| id: changed_addons | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| git fetch origin "${{ github.base_ref }}" --depth=1 | |
| files=$(git diff --name-only --diff-filter=AM "origin/${{ github.base_ref }}" HEAD -- addons || true) | |
| else | |
| files=$(git ls-files addons) | |
| fi | |
| { | |
| echo "changed_addons<<EOF" | |
| echo "$files" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Review addon tags | |
| if: steps.changed_addons.outputs.changed_addons != '' | |
| shell: bash | |
| env: | |
| PYTHONPATH: src | |
| run: | | |
| mapfile -t files < <(printf '%s\n' "${{ steps.changed_addons.outputs.changed_addons }}" | sed '/^$/d') | |
| if [ "${#files[@]}" -eq 0 ]; then | |
| echo "No addon files to review" | |
| exit 0 | |
| fi | |
| python3 -m zotero_scraper.tag_review \ | |
| --files "${files[@]}" \ | |
| --summary-file "$GITHUB_STEP_SUMMARY" | |
| - name: No addon changes | |
| if: steps.changed_addons.outputs.changed_addons == '' | |
| run: echo "No addon files require tag review" |