-
Notifications
You must be signed in to change notification settings - Fork 189
75 lines (66 loc) · 2.34 KB
/
open-pr-on-optimized-symbolic-icons-changes.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Open/Update PR when symbolic icons needs to be optimized
on:
push:
paths:
- '.github/workflows/open-pr-on-optimized-symbolic-icons-changes.yaml'
- 'icons/src/scalable/**'
schedule:
- cron: '8 0 * * *'
permissions:
pull-requests: write
contents: write
jobs:
refresh-upstream:
name: Check for optimized SVG icons changes
runs-on: ubuntu-latest
steps:
- name: Checkout Yaru code
uses: actions/checkout@v4
- name: Setup common variables
id: env
run: |
echo "::set-output name=push-branch::auto-optimized-symbolic-icons"
- name: Install dependencies
run: |
sudo apt install scour
- name: Check Source changes
uses: dorny/paths-filter@v3
id: check-changed
with:
base: ${{ steps.env.outputs.push-branch }}
filters: |
default:
- icons/src/scalable/default/**
- icons/src/scalable/render-symbolic-icons.sh
mate:
- icons/src/scalable/mate/**
- icons/src/scalable/render-symbolic-icons.sh
- name: Optimize default SVGs
if: steps.check-changed.outputs.default == 'true'
run: |
cd icons/src/scalable
./render-symbolic-icons.sh --variant default
- name: Optimize mate SVGs
if: steps.check-changed.outputs.mate == 'true'
run: |
cd icons/src/scalable
./render-symbolic-icons.sh --variant mate
- name: Check Optimization changes
id: check_optimization_changes
run: |
if [ -z "$(git status --porcelain)" ]; then
changed=false
else
changed=true
fi
echo "::set-output name=modified::${changed}"
- name: Create or update Pull Request
if: steps.check_optimization_changes.outputs.modified == 'true'
uses: peter-evans/create-pull-request@v7
with:
commit-message: "icons: Optimize symbolic icons"
title: Auto optimized symbolic icons updates
labels: automated pr
body: "[New rendered icons / symlinks changes](https://github.com/ubuntu/yaru/actions/workflows/open-pr-on-optimized-symbolic-icons-changes.yaml) by GitHub Action"
branch: ${{ steps.env.outputs.push-branch }}
token: ${{ secrets.GITHUB_TOKEN }}