-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store epic-stack latest commit hash in the package.json (#805)
Co-authored-by: GitHub Action <[email protected]> Co-authored-by: kody <[email protected]> Co-authored-by: Kent C. Dodds <[email protected]> Co-authored-by: kody <[email protected]>
- Loading branch information
1 parent
ffc7d04
commit a88ea9e
Showing
4 changed files
with
62 additions
and
1 deletion.
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,54 @@ | ||
name: 🔖 Version | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
version: | ||
name: 🚀 Update Version | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🔢 Get HEAD commit hash | ||
id: get_head_hash | ||
run: echo "HEAD_HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: 📅 Get current date | ||
id: get_date | ||
run: | ||
echo "CURRENT_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
|
||
- name: 📝 Update package.json | ||
run: | | ||
jq ' | ||
if .["epic-stack"] then | ||
.["epic-stack"].head = "${{ steps.get_head_hash.outputs.HEAD_HASH }}" | | ||
.["epic-stack"].date = "${{ steps.get_date.outputs.CURRENT_DATE }}" | ||
else | ||
.["epic-stack"] = { | ||
"head": "${{ steps.get_head_hash.outputs.HEAD_HASH }}", | ||
"date": "${{ steps.get_date.outputs.CURRENT_DATE }}" | ||
} | ||
end | ||
' package.json > temp.json && mv temp.json package.json | ||
- name: 💾 Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "kody" | ||
git add package.json | ||
git commit -m "Update epic-stack version [skip ci]" | ||
git push |
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
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 |
---|---|---|
|
@@ -3,7 +3,10 @@ | |
"private": true, | ||
"sideEffects": false, | ||
"license": "MIT", | ||
"epic-stack": true, | ||
"epic-stack": { | ||
"head": "6c9d4d2b353e54d70f0378854af95c4cdfd6515e", | ||
"date": "2024-08-03T00:02:41Z" | ||
}, | ||
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)", | ||
"type": "module", | ||
"imports": { | ||
|
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