From 05f0d5948f707fbed2be280a4f408eb6069162bb Mon Sep 17 00:00:00 2001 From: boubou19 Date: Wed, 23 Jul 2025 20:06:07 +0200 Subject: [PATCH] fix derp --- .github/workflows/optimize-images.yml | 38 +++++++++++++-------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/optimize-images.yml b/.github/workflows/optimize-images.yml index fd592a3..c3b6a30 100644 --- a/.github/workflows/optimize-images.yml +++ b/.github/workflows/optimize-images.yml @@ -20,7 +20,6 @@ jobs: find . -type f -name "*.png" ! -path "./.git/*" -exec optipng -o7 {} + - name: Check for changes - id: git-diff run: | if [[ -n "$(git status --porcelain)" ]]; then echo "Everything is already correctly compressed." @@ -31,25 +30,24 @@ jobs: fi - name: Create Pull Request if Needed - if: steps.compress-images.outputs.markdown_report != '' if: ${{ failure() && github.event_name == 'pull_request' && !github.event.pull_request.draft }} - run: | - git config user.name "GitHub GTNH Actions" - git config user.email "<>" - git switch -c "${FIXED_BRANCH}" - git commit -am "optimizing images" - git push --force-with-lease origin "${FIXED_BRANCH}" - gh pr create \ - --head "${FIXED_BRANCH}" \ - --base "${PR_BRANCH}" \ - --title "Optimising images contained in ${PR_BRANCH} for #${{ github.event.pull_request.number }}" \ - --body "Automatic image compression, applies to PR #${{ github.event.pull_request.number }}" \ - 2>&1 | tee pr-message.log || true - gh pr comment "${PR_BRANCH}" -F pr-message.log || true - shell: - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_BRANCH: ${{ github.head_ref }} - FIXED_BRANCH: ${{ github.head_ref }}-image-compression + run: | + git config user.name "GitHub GTNH Actions" + git config user.email "<>" + git switch -c "${FIXED_BRANCH}" + git commit -am "optimizing images" + git push --force-with-lease origin "${FIXED_BRANCH}" + gh pr create \ + --head "${FIXED_BRANCH}" \ + --base "${PR_BRANCH}" \ + --title "Optimising images contained in ${PR_BRANCH} for #${{ github.event.pull_request.number }}" \ + --body "Automatic image compression, applies to PR #${{ github.event.pull_request.number }}" \ + 2>&1 | tee pr-message.log || true + gh pr comment "${PR_BRANCH}" -F pr-message.log || true + shell: + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_BRANCH: ${{ github.head_ref }} + FIXED_BRANCH: ${{ github.head_ref }}-image-compression \ No newline at end of file