Skip to content

Commit a4f00f8

Browse files
CopilotDavidKRKCopilot
authored
fix(maintenance): write backup archive to $RUNNER_TEMP to prevent tar self-inclusion error (#225)
* fix(maintenance): create tar archive in /tmp to prevent backup job failure Agent-Logs-Url: https://github.com/DavidKRK/DavidKRK.github.io/sessions/f2fba114-abbe-42c4-8023-e036d31ccb80 Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> * Potential fix for pull request finding Pull request Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * refactor(maintenance): use ARCHIVE_PATH variable via RUNNER_TEMP for archive location Agent-Logs-Url: https://github.com/DavidKRK/DavidKRK.github.io/sessions/28d26abc-53c6-46d1-8b04-6b7006533e10 Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f6696f1 commit a4f00f8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/maintenance.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,17 @@ jobs:
125125
run: |
126126
DATE=$(date +%Y-%m-%d)
127127
ARCHIVE_NAME="davidkrk-backup-${DATE}.tar.gz"
128+
# Écrire l'archive hors du répertoire courant pour éviter "file changed as we read it"
129+
ARCHIVE_PATH="${RUNNER_TEMP}/${ARCHIVE_NAME}"
128130
129-
# Créer l'archive dans /tmp pour éviter que tar n'archive son propre fichier de sortie
130-
tar -czf "/tmp/$ARCHIVE_NAME" \
131+
tar -czf "$ARCHIVE_PATH" \
131132
--exclude='.git' \
132133
--exclude='node_modules' \
133134
--exclude='dist' \
134135
.
135136
136-
# Déplacer l'archive vers le répertoire courant pour l'étape de release
137-
mv "/tmp/$ARCHIVE_NAME" "./$ARCHIVE_NAME"
138-
139-
ARCHIVE_SIZE=$(du -sh "$ARCHIVE_NAME" | cut -f1)
140-
echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT"
137+
ARCHIVE_SIZE=$(du -sh "$ARCHIVE_PATH" | cut -f1)
138+
echo "archive_name=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"
141139
echo "archive_size=$ARCHIVE_SIZE" >> "$GITHUB_OUTPUT"
142140
echo "date=$DATE" >> "$GITHUB_OUTPUT"
143141
echo "✅ Archive créée : $ARCHIVE_NAME ($ARCHIVE_SIZE)"

0 commit comments

Comments
 (0)