-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build zip-artifact containing the latest commit hash
- Loading branch information
1 parent
ba0156c
commit 31cab3b
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |