forked from wp-plugins/more-privacy-options
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.39 KB
/
briefcase.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
name: MACS Briefcase Update
on:
push:
branches:
- master
jobs:
briefcase-update:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
path: source
- name: Checkout target repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.macs_briefcase }}
token: ${{ secrets.gh_bot_pat }}
path: target
- name: Prepare and push Briefcase
run: |
[ ! -d "target/projects/${{ github.event.repository.name }}" ] && mkdir -p "target/projects/${{ github.event.repository.name }}"
rsync -zarv --prune-empty-dirs --include='*/' --include='*.md' --exclude='*' source/ target/projects/${{ github.event.repository.name }}/
cd target
find . -type d -name "vendor" -exec rm -rf {} +
find . -type d -name "autoload" -exec rm -rf {} +
find . -type d -name "lib" -exec rm -rf {} +
find . -type d -name "Pods" -exec rm -rf {} +
git config --global user.name "${{ secrets.gh_bot_name }}"
git config --global user.email "${{ secrets.gh_bot_email }}"
git add .
if [ -n "$(git status --porcelain)" ]; then
git commit -m "Briefcase updated from ${{ github.repository }}"
git push --force
else
echo "No changes detected. Exiting without pushing."
fi