-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (76 loc) · 2.95 KB
/
sync-cms.yaml
File metadata and controls
76 lines (76 loc) · 2.95 KB
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
76
name: Sync Sling Starter to CMS
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Sling Starter
uses: actions/checkout@v4
with:
repository: apache/sling-org-apache-sling-starter
path: starter
token: ${{ secrets.GH_PAT }}
- name: Check for Structural Updates
run: |
SUM=$(tree starter/src/main/features | sha256sum)
if [[ "$SUM" != "61a96710823a07199ed5190eefd18606a53da448041470371b82d3e844083f9d -" ]]; then
echo "Starter Feature Structure Change Detected!"
echo "New sum: $SUM"
tree starter/src/main/features
exit 1
fi
- name: Checkout Sling App CMS
uses: actions/checkout@v4
with:
repository: apache/sling-org-apache-sling-app-cms
path: cms
token: ${{ secrets.GH_PAT }}
- name: Update Feature Files
run: |
cp starter/src/main/features/*.json cms/feature/src/main/features
cp starter/src/main/features/*.txt cms/feature/src/main/features
cp starter/src/main/features/oak/oak_base.json cms/feature/src/main/features/oak
cp starter/src/main/features/app/composum.json cms/feature/src/main/features/app
cp starter/src/main/features/app/htl_repl.json cms/feature/src/main/features/app
- name: Tweak Dependencies
run: |
sed -i "s@tika-parsers@tika-bundle@g" cms/feature/src/main/features/base.json
- name: Updating POM Dependency Versions
run: |
sudo apt-get install -y libxml-xpath-perl
PROPERTIES=(
"asm.version"
"jackrabbit.version"
"oak.version"
"slf4j.version"
"composum.version"
"jackson.version"
"groovy.version"
)
for PROP in ${PROPERTIES[@]}; do
VERSION=$(xpath -q -e "string(/project/properties/${PROP}/text())" starter/pom.xml)
echo "Setting ${PROP} to ${VERSION}"
sed -i "s@<$PROP>.*</$PROP>@<$PROP>$VERSION</$PROP>@g" cms/pom.xml
done
- name: Check for modified files
id: git-check
run: |
cd cms
echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")
- name: Create Pull Request
if: steps.git-check.outputs.modified == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_PAT }}
commit-message: "SLING-11069 - Sync Latest Change from Starter"
title: 'SLING-11069 - Sync Latest Change from Starter'
path: cms
body: >
This PR is auto-generated by
[sync-cms](https://github.com/klcodanr/Scripts/blob/master/.github/workflows/sync-cms.yaml).
labels: dependencies,automated pr
branch: SLING-11069
base: master