Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- name: Checkout code changes
uses: actions/checkout@v4

# bump: ffmpeg-ci /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
# bump: ffmpeg-ci /ffmpeg-version: '([\d.]+)'/ docker:mwader/static-ffmpeg|~7.0
ffmpeg-version: '7.0.2'
run: |
docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
echo "$PWD" >> "$GITHUB_PATH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Linux-centric command breaks Windows runners

${{ matrix.os }} includes windows-latest, but the step is executed with the default PowerShell shell on Windows.
$PWD and the here-string used to pipe a Dockerfile into docker build are bash-isms and will raise “command not found” in PowerShell, causing the whole Windows leg to fail.

Minimal fix:

-      - name: Setup FFmpeg
-        run: |
-          docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
-          echo "$PWD" >> "$GITHUB_PATH"
+      - name: Setup FFmpeg
+        shell: bash                       # ensure a POSIX shell on all runners
+        run: |
+          docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
+          printf '%s\n' "$PWD" >> "$GITHUB_PATH"

Alternatively gate the step to if: runner.os == 'Linux'.


🏁 Script executed:

#!/bin/bash
set -e
# Display the top of the workflow to confirm matrix.os and runs-on
sed -n '1,80p' .github/workflows/unit-test.yml

Length of output: 2253


Ensure FFmpeg setup only runs on Linux and uses a POSIX shell
The current FFmpeg step uses bash-isms ($PWD, here-string, $(…)) and Docker (not available on macOS) under the default PowerShell on Windows, so it will fail on both Windows and macOS runners.

• File: .github/workflows/unit-test.yml
• Lines: 26–30

Recommended changes:

  • Add if: runner.os == 'Linux' to skip this step on Windows & macOS
  • Specify shell: bash to force a POSIX shell when it does run
  • Use printf instead of echo for better cross-shell safety
       - name: Setup FFmpeg
-        run: |
-          docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
-          echo "$PWD" >> "$GITHUB_PATH"
+        if: runner.os == 'Linux'
+        shell: bash
+        run: |
+          docker run --rm -v "$PWD:/out" \
+            $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
+          printf '%s\n' "$PWD" >> "$GITHUB_PATH"

Alternatively, provide native ffmpeg installs on macOS (brew install ffmpeg) and Windows (choco install ffmpeg) if tests require ffmpeg there.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# bump: ffmpeg-ci /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
# bump: ffmpeg-ci /ffmpeg-version: '([\d.]+)'/ docker:mwader/static-ffmpeg|~7.0
ffmpeg-version: '7.0.2'
run: |
docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
echo "$PWD" >> "$GITHUB_PATH"
# bump: ffmpeg-ci /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
- name: Setup FFmpeg
if: runner.os == 'Linux'
shell: bash
run: |
docker run --rm -v "$PWD:/out" \
$(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:7.0.2 /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
printf '%s\n' "$PWD" >> "$GITHUB_PATH"
🤖 Prompt for AI Agents
In .github/workflows/unit-test.yml at lines 26 to 30, the FFmpeg setup step uses
bash-specific syntax and Docker, which is unavailable on macOS and Windows
runners, causing failures. Fix this by adding `if: runner.os == 'Linux'` to run
the step only on Linux, specify `shell: bash` to enforce a POSIX shell, and
replace `echo` with `printf` for better cross-shell compatibility.


- name: Setup Java
uses: actions/setup-java@v4
Expand Down
Loading