Skip to content

fix(maintenance): backup job fails every Sunday — tar archives its own output#230

Merged
DavidKRK merged 1 commit into
gh-pagesfrom
copilot/fix-maintenance-workflow-errors
May 10, 2026
Merged

fix(maintenance): backup job fails every Sunday — tar archives its own output#230
DavidKRK merged 1 commit into
gh-pagesfrom
copilot/fix-maintenance-workflow-errors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 10, 2026

The weekly backup job (cron: '0 1 * * 0') always exits 1 because tar writes the archive into . (the source directory it is reading), triggering tar: .: file changed as we read it. The --exclude='*.tar.gz' guard is ineffective — the file already exists in the directory tree before tar can exclude it.

Fix

Write the archive to /tmp first, then move it into the workspace after tar completes:

- tar -czf "$ARCHIVE_NAME" \
-   --exclude='.git' \
-   --exclude='node_modules' \
-   --exclude='dist' \
-   --exclude='*.tar.gz' \
-   .
+ tar -czf "/tmp/$ARCHIVE_NAME" \
+   --exclude='.git' \
+   --exclude='node_modules' \
+   --exclude='dist' \
+   .
+ mv "/tmp/$ARCHIVE_NAME" "./$ARCHIVE_NAME"

The subsequent softprops/action-gh-release step is unchanged — it still picks up the archive by filename from the working directory.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 10, 2026

Deploy Preview for whimsical-kitsune-85066d ready!

Name Link
🔨 Latest commit 43b9047
🔍 Latest deploy log https://app.netlify.com/projects/whimsical-kitsune-85066d/deploys/6a00dc6b4c86f400082ce24b
😎 Deploy Preview https://deploy-preview-230--whimsical-kitsune-85066d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@DavidKRK DavidKRK marked this pull request as ready for review May 10, 2026 19:28
Copilot AI review requested due to automatic review settings May 10, 2026 19:28
@netlify
Copy link
Copy Markdown

netlify Bot commented May 10, 2026

Deploy Preview for spiffy-liger-8bab58 ready!

Name Link
🔨 Latest commit 43b9047
🔍 Latest deploy log https://app.netlify.com/projects/spiffy-liger-8bab58/deploys/6a00dc6b2d95d2000833bd28
😎 Deploy Preview https://deploy-preview-230--spiffy-liger-8bab58.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the weekly maintenance backup workflow failure caused by tar writing its output archive into the same directory tree it is archiving (triggering file changed as we read it), by generating the archive outside the source directory and then moving it into place for the release step.

Changes:

  • Generate the backup archive in /tmp instead of the repository workspace to prevent self-archiving.
  • Move the completed archive back into the workspace so the existing GitHub Release upload step continues to work unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/maintenance.yml
@DavidKRK DavidKRK merged commit ea2da9c into gh-pages May 10, 2026
25 checks passed
@DavidKRK DavidKRK deleted the copilot/fix-maintenance-workflow-errors branch May 10, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants