-
Notifications
You must be signed in to change notification settings - Fork 9
70 lines (61 loc) · 2.13 KB
/
update-website-v2.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
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
name: Update boostlook.css in website-v2 repository
on:
push:
branches: [ "develop" ]
paths:
- 'boostlook.css'
permissions:
pull-requests: write
jobs:
update-css:
runs-on: ubuntu-latest
if: github.repository == 'boostorg/boostlook'
steps:
- name: Checkout boostlook repository
uses: actions/checkout@v4
with:
repository: boostorg/boostlook
- name: Checkout website-v2 repository
uses: actions/checkout@v4
with:
repository: boostorg/website-v2
ref: develop
path: website-v2
token: ${{ secrets.WEBSITE_V2_PAT }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Copy boostlook.css to website-v2
run: |
cp -v boostlook.css website-v2/static/css/boostlook.css
- name: Install pre-commit
if: success()
run: |
pip install pre-commit
- name: Run pre-commit hooks on boostlook.css
if: success()
working-directory: website-v2
run: |
pre-commit run --files static/css/boostlook.css
- name: Commit and push changes to a new branch
if: success()
working-directory: website-v2
env:
GH_TOKEN: ${{ secrets.WEBSITE_V2_PAT }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add static/css/boostlook.css
if ! git diff-index --quiet HEAD; then
git commit -m "Update boostlook.css from boostlook repository"
branch_name="update-boostlook-css-$(date +'%Y%m%d%H%M%S')"
git checkout -b "$branch_name"
git push origin "$branch_name"
gh pr create --title "Update boostlook.css from boostlook repository" \
--body "Automated PR to update boostlook.css" \
--base develop \
--head "$branch_name"
else
echo "No changes to commit. Skipping PR creation."
fi