mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2025-08-29 06:40:10 +02:00
fix derp
This commit is contained in:
parent
480322a45e
commit
05f0d5948f
38
.github/workflows/optimize-images.yml
vendored
38
.github/workflows/optimize-images.yml
vendored
@ -20,7 +20,6 @@ jobs:
|
|||||||
find . -type f -name "*.png" ! -path "./.git/*" -exec optipng -o7 {} +
|
find . -type f -name "*.png" ! -path "./.git/*" -exec optipng -o7 {} +
|
||||||
|
|
||||||
- name: Check for changes
|
- name: Check for changes
|
||||||
id: git-diff
|
|
||||||
run: |
|
run: |
|
||||||
if [[ -n "$(git status --porcelain)" ]]; then
|
if [[ -n "$(git status --porcelain)" ]]; then
|
||||||
echo "Everything is already correctly compressed."
|
echo "Everything is already correctly compressed."
|
||||||
@ -31,25 +30,24 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create Pull Request if Needed
|
- 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 }}
|
if: ${{ failure() && github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
||||||
run: |
|
run: |
|
||||||
git config user.name "GitHub GTNH Actions"
|
git config user.name "GitHub GTNH Actions"
|
||||||
git config user.email "<>"
|
git config user.email "<>"
|
||||||
git switch -c "${FIXED_BRANCH}"
|
git switch -c "${FIXED_BRANCH}"
|
||||||
git commit -am "optimizing images"
|
git commit -am "optimizing images"
|
||||||
git push --force-with-lease origin "${FIXED_BRANCH}"
|
git push --force-with-lease origin "${FIXED_BRANCH}"
|
||||||
gh pr create \
|
gh pr create \
|
||||||
--head "${FIXED_BRANCH}" \
|
--head "${FIXED_BRANCH}" \
|
||||||
--base "${PR_BRANCH}" \
|
--base "${PR_BRANCH}" \
|
||||||
--title "Optimising images contained in ${PR_BRANCH} for #${{ github.event.pull_request.number }}" \
|
--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 }}" \
|
--body "Automatic image compression, applies to PR #${{ github.event.pull_request.number }}" \
|
||||||
2>&1 | tee pr-message.log || true
|
2>&1 | tee pr-message.log || true
|
||||||
gh pr comment "${PR_BRANCH}" -F pr-message.log || true
|
gh pr comment "${PR_BRANCH}" -F pr-message.log || true
|
||||||
shell:
|
shell:
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
PR_BRANCH: ${{ github.head_ref }}
|
PR_BRANCH: ${{ github.head_ref }}
|
||||||
FIXED_BRANCH: ${{ github.head_ref }}-image-compression
|
FIXED_BRANCH: ${{ github.head_ref }}-image-compression
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user