Skip to content

Commit

Permalink
Build zip-artifact containing the latest commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminaaron committed Apr 5, 2024
1 parent ba0156c commit 31cab3b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build zip with latest commit hash
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: check out repository
uses: actions/checkout@v3
- name: get latest commit hash
run: echo "LATEST_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: create commit hash file
run: echo $LATEST_COMMIT_HASH > latest_commit_hash.txt
- name: Archive Repository with Commit Hash
run: zip -r archive_with_hash.zip . -x "*.git*"
- name: Upload Archive as Artifact
uses: actions/upload-artifact@v3
with:
name: repo-archive-with-hash
path: archive_with_hash.zip

0 comments on commit 31cab3b

Please sign in to comment.