Skip to content

Commit

Permalink
Update MACS Briefcase Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
macs-bot committed Nov 8, 2023
1 parent e2b7910 commit 7bbe702
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/briefcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
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

0 comments on commit 7bbe702

Please sign in to comment.