From b4fd76a206d2d4e7ec440c7dcaa3bef7829527a2 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 28 Nov 2022 16:03:17 +0200 Subject: [PATCH] Fixes and updates --- .github/workflows/composer-install.yml | 7 +++++++ .github/workflows/compress-images.yml | 4 +++- .github/workflows/pr-compress-images.yml | 9 ++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/composer-install.yml b/.github/workflows/composer-install.yml index 971ef96..ef2fb07 100644 --- a/.github/workflows/composer-install.yml +++ b/.github/workflows/composer-install.yml @@ -1,5 +1,12 @@ name: Run Composer Install +on: + workflow_dispatch: + pull_request: + paths: + - 'composer.json' + - 'composer.lock' + jobs: ComposerInstall: runs-on: ubuntu-latest diff --git a/.github/workflows/compress-images.yml b/.github/workflows/compress-images.yml index 4e73fbc..b47e278 100644 --- a/.github/workflows/compress-images.yml +++ b/.github/workflows/compress-images.yml @@ -6,18 +6,20 @@ on: schedule: - cron: '00 23 * * 0' jobs: - build: + CompressOnDemandOrSchedule: name: calibreapp/image-actions runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v2 + - name: Compress Images id: calibre uses: calibreapp/image-actions@main with: githubToken: ${{ secrets.GITHUB_TOKEN }} compressOnly: true + - name: Create New Pull Request If Needed if: steps.calibre.outputs.markdown != '' uses: peter-evans/create-pull-request@v3 diff --git a/.github/workflows/pr-compress-images.yml b/.github/workflows/pr-compress-images.yml index 34dc173..07731c3 100644 --- a/.github/workflows/pr-compress-images.yml +++ b/.github/workflows/pr-compress-images.yml @@ -9,7 +9,7 @@ on: - '**.png' - '**.webp' jobs: - build: + CompressInPR: # Only run on Pull Requests within the same repository, and not from forks. if: github.event.pull_request.head.repo.full_name == github.repository name: calibreapp/image-actions @@ -21,6 +21,9 @@ jobs: - name: Compress Images uses: calibreapp/image-actions@main with: - # The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories. - # See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions + # The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is + # currently running the action. By default, the action can’t update Pull Requests initiated from + # forked repositories. + # See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and + # https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions githubToken: ${{ secrets.GITHUB_TOKEN }}