Skip to content

Commit

Permalink
Update pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminaaron committed Apr 5, 2024
1 parent 4d225d3 commit 8e7e107
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
- 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

0 comments on commit 8e7e107

Please sign in to comment.