generated from ecomplus/storefront-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.19 KB
/
optimize-and-merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Optimize and merge
on: pull_request
jobs:
compress-images:
name: Compress repository images
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.title, '[skip ci]') &&
!startsWith(github.head_ref, 'chore')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Optimize with Calibre's image actions
uses: calibreapp/image-actions@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Wait images optimization
run: sleep 120
auto-merge:
name: Auto merge dependencies PRs
runs-on: ubuntu-latest
if: |
github.actor == 'renovate[bot]' ||
github.actor == 'renovate-preview[bot]'
steps:
- name: Squash and merge
if: |
contains(github.event.pull_request.body, 'Automerge**: Enabled')
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
merge_method: 'squash'
})