forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1.36 KB
/
update-font.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
name: Font update check
# **What it does**: Checks that the font cachebuster parameter has been updated if the font file has changed
# **Why we have it**: To make sure that browser font caching is invalidated and the updated font is used
# **Who does it impact**: Any PR which changes the font file
on:
pull_request:
types: [synchronize, opened]
paths:
- 'plugins/Morpheus/fonts/matomo.*'
permissions:
actions: read
checks: read
contents: read
deployments: none
issues: read
packages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: read
jobs:
check:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Compare stylesheet to base branch
run: |
if [[ $(wget -O - -o /dev/null https://raw.githubusercontent.com/matomo-org/matomo/$GITHUB_BASE_REF/plugins/Morpheus/stylesheets/base/icons.css | grep -m1 -- "format('woff2')") == $(grep -m1 -- "format('woff2')" plugins/Morpheus/stylesheets/base/icons.css) ]]
then
line=$(grep -n "format('woff2')" plugins/Morpheus/stylesheets/base/icons.css | cut -f1 -d:)
echo "::error file=plugins/Morpheus/stylesheets/base/icons.css,line=$line::Font cachebuster parameter not updated. See https://developer.matomo.org/guides/matomo-font"
exit 1
else
exit 0
fi