Skip to content

Commit

Permalink
Conditionally run upload artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Sep 5, 2024
1 parent 1fbb8e4 commit 355b4ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ jobs:
LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH}"
python "${EXAMPLE_FILE}"
popd
if [ "$(ls figs | wc -l)" -gt "0" ]; then
echo "ARTIFACT_NAME=${EXAMPLE_FILE}" >> $GITHUB_ENV
fi
- name: Upload figures
uses: actions/upload-artifact@v4
if: ${{ env.ARTIFACT_NAME }} != ""
with:
name: "${{ matrix.example }}"
name: "${{ env.ARTIFACT_NAME }}"
path: figs/

0 comments on commit 355b4ef

Please sign in to comment.