Skip to content

Commit b00c6b7

Browse files
committed
modify the image action to run monthly
1 parent ff62713 commit b00c6b7

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/images.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: Compress Images
22
on:
3-
pull_request:
4-
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed.
5-
# See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference.
6-
paths:
7-
- '**.jpg'
8-
- '**.jpeg'
9-
- '**.png'
10-
- '**.webp'
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 1 * *'
116
jobs:
127
build:
13-
# Only run on Pull Requests within the same repository, and not from forks.
14-
if: github.event.pull_request.head.repo.full_name == github.repository
158
name: calibreapp/image-actions
169
runs-on: ubuntu-latest
1710
steps:
1811
- name: Checkout Repo
1912
uses: actions/checkout@v3
20-
2113
- name: Compress Images
14+
id: calibre
2215
uses: calibreapp/image-actions@main
2316
with:
24-
# 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.
25-
# 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
2617
githubToken: ${{ secrets.GITHUB_TOKEN }}
18+
compressOnly: true
19+
- name: Create New Pull Request If Needed
20+
if: steps.calibre.outputs.markdown != ''
21+
uses: peter-evans/create-pull-request@v4
22+
with:
23+
title: Compressed Images Nightly
24+
branch-suffix: timestamp
25+
commit-message: Compressed Images
26+
body: ${{ steps.calibre.outputs.markdown }}

0 commit comments

Comments
 (0)