From 8e7e10705f393d0b5d12f3461b1af375f8e97167 Mon Sep 17 00:00:00 2001 From: Benjamin Degenhart Date: Fri, 5 Apr 2024 22:36:42 +0200 Subject: [PATCH] Update pipeline.yml --- .github/workflows/pipeline.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 206221c..bd01c9b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,23 +9,27 @@ jobs: permissions: contents: write steps: - - name: check out repository + - name: Check out repository uses: actions/checkout@v3 - - name: create latest commit hash file + + - name: Create latest commit hash file run: echo $(git rev-parse HEAD) >> latest_commit_hash.txt + - name: Archive Repository with Commit Hash run: zip -r archive_with_hash.zip . -x "*.git*" -x "*.github*" - - name: Configure git user + + - name: Clone zip-archive branch in a separate directory + uses: actions/checkout@v3 + with: + ref: zip-archive + path: zip-archive-dir + + - name: Replace ZIP file in zip-archive branch run: | + mv archive_with_hash.zip zip-archive-dir/ + cd zip-archive-dir git config user.name "github-actions" git config user.email "github-actions@github.com" - - name: Create orphan branch for ZIP archive - run: | - git checkout --orphan zip-archive - git rm -rf . - git clean -fdx git add archive_with_hash.zip git commit -m "Update ZIP archive with latest commit hash" - - - name: Force push to remote zip-archive branch - run: git push origin zip-archive --force + git push origin zip-archive --force