forked from in-toto/go-witness
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: implemented git-conventional-commits
this helps enable generating our versions and changelog from our git tree helps close in-toto#9
- Loading branch information
1 parent
120aa80
commit 091622f
Showing
4 changed files
with
90 additions
and
4 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,51 @@ | ||
--- | ||
convention: | ||
commitTypes: | ||
- feat | ||
- fix | ||
- perf | ||
- refactor | ||
- style | ||
- story | ||
- test | ||
- build | ||
- ops | ||
- docs | ||
- chore | ||
- merge | ||
- spike | ||
- revert | ||
commitScopes: [] | ||
releaseTagGlobPattern: v[0-9]*.[0-9]*.[0-9]* | ||
changelog: | ||
commitTypes: | ||
- chore | ||
- docs | ||
- feat | ||
- fix | ||
- perf | ||
- story | ||
- merge | ||
includeInvalidCommits: true | ||
commitIgnoreRegexPattern: "^WIP " | ||
headlines: | ||
feat: Features | ||
fix: Bug Fixes | ||
perf: Performance Improvements | ||
merge: Merges | ||
chore: Chores | ||
docs: Documentation | ||
story: Stories | ||
breakingChange: BREAKING CHANGES | ||
|
||
## GitHub | ||
# commitUrl: https://github.com/ACCOUNT/REPOSITORY/commit/%commit% | ||
# commitRangeUrl: https://github.com/ACCOUNT/REPOSITORY/compare/%from%...%to%?diff=split | ||
|
||
## GitHub Issues | ||
# issueRegexPattern: "#[0-9]+" | ||
# issueUrl: https://github.com/ACCOUNT/REPOSITORY/issues/%issue% | ||
|
||
## Jira Issues | ||
# issueRegexPattern: "[A-Z][A-Z0-9]+-[0-9]+" | ||
# issueUrl: https://WORKSPACE.atlassian.net/browse/%issue% |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# update-platform-version | ||
# This script helps us keep our platform version up to date | ||
|
||
version_output=$(npx git-conventional-commits version) | ||
latest_version=$(echo "$version_output" | tail -n 1) | ||
current_version=$(node -pe "require('./package.json').version") | ||
|
||
# Update the package.json file with the new version | ||
if [[ $latest_version != $current_version ]]; then | ||
node -e " | ||
const fs = require('fs'); | ||
const packageJson = JSON.parse(fs.readFileSync('package.json')); | ||
const packageLockJson = JSON.parse(fs.readFileSync('package-lock.json')); | ||
packageJson.version = '${latest_version}'; | ||
packageLockJson.version = '${latest_version}'; | ||
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2)); | ||
fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJson, null, 2)); | ||
" | ||
|
||
# Stage the updated package.json file | ||
git add package.json | ||
git add package-lock.json | ||
|
||
echo "Updated package.json version to ${latest_version} and staged the file." | ||
else | ||
echo "No version update found in git-conventional-commits." | ||
fi |