diff --git a/.github/workflows/ci_PR.yml b/.github/workflows/ci_PR.yml index 886473a5..68402523 100644 --- a/.github/workflows/ci_PR.yml +++ b/.github/workflows/ci_PR.yml @@ -102,10 +102,33 @@ jobs: INPUT_SHOW_LANGUAGE_PER_REPO: True INPUT_SHOW_UPDATED_DATE: True - run: python3 sources/main.py + run: | + mkdir -p preview + python3 sources/main.py 2>&1 | tee preview/run.log - - name: Upsert preview comment 💬 + - name: Write preview markdown if: ${{ steps.changed.outputs.code == 'true' }} + env: + README_CONTENT: ${{ steps.make-stats.outputs.README_CONTENT }} + run: | + mkdir -p preview + printf '%s\n' "$README_CONTENT" > preview/preview.md + if [ ! -s preview/preview.md ]; then + echo "README_CONTENT was empty." > preview/preview.md + fi + + - name: Upload preview artifact + if: ${{ always() && steps.changed.outputs.code == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: preview-stats + path: | + preview/preview.md + preview/run.log + if-no-files-found: ignore + + - name: Upsert preview comment 💬 + if: ${{ steps.changed.outputs.code == 'true' && github.event.pull_request.head.repo.full_name == github.repository }} uses: actions/github-script@v7 env: README_CONTENT: ${{ steps.make-stats.outputs.README_CONTENT }} @@ -173,4 +196,4 @@ jobs: } } catch (e) { core.warning(`Unable to create/update PR comment: ${e.message || e}`) - } \ No newline at end of file + } diff --git a/action.yml b/action.yml index 22ba695c..50a1d7aa 100644 --- a/action.yml +++ b/action.yml @@ -169,7 +169,7 @@ inputs: runs: using: 'docker' - image: 'Dockerfile' + image: 'docker://wakareadmestats/waka-readme-stats:master' branding: icon: 'activity'