Skip to content

Commit af5059a

Browse files
committed
Exclude workflow files from rsync in GitHub Actions workflow
1 parent bfafc07 commit af5059a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/update-pages-branch.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ jobs:
3636
git worktree add "$WORKTREE_DIR" feature/github-pages-deploy
3737
trap 'git worktree remove --force "$WORKTREE_DIR"' EXIT
3838
39-
rsync -a --delete --exclude ".git" --exclude ".github/pages-overlay/" ./ "$WORKTREE_DIR"/
39+
# Sync all files except .git, pages-overlay, and workflow files
40+
# Workflow files are excluded because GITHUB_TOKEN cannot modify them
41+
rsync -a --delete --exclude ".git" --exclude ".github/pages-overlay/" --exclude ".github/workflows/" ./ "$WORKTREE_DIR"/
4042
43+
# Sync pages-overlay if it exists, but skip workflow files
4144
if [ -d ".github/pages-overlay" ]; then
42-
rsync -a .github/pages-overlay/ "$WORKTREE_DIR/.github/"
45+
rsync -a --exclude "workflows/" .github/pages-overlay/ "$WORKTREE_DIR/.github/"
4346
fi
4447
4548
cd "$WORKTREE_DIR"

0 commit comments

Comments
 (0)