-
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.
Add changelog script. Add Generate changelog step
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 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,31 @@ | ||
#!/bin/bash | ||
|
||
# Check if 'packages', 'current_package' and 'token' are provided as command line arguments | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <current_package> <token>" | ||
exit 1 | ||
fi | ||
|
||
# Assign command line arguments to variables | ||
packages=("components" "tokens") | ||
current_package="$1" | ||
token="$2" | ||
|
||
# Filter out current package | ||
filtered_array=() | ||
for value in "${packages[@]}" | ||
do | ||
[[ $value != $current_package ]] && filtered_array+=($value) | ||
done | ||
|
||
# Add regex to each item in array | ||
filtered_array=( "${filtered_array[@]/%/-.*}" ) | ||
|
||
# Join strings with pipe char | ||
joined_string=$(IFS="|"; echo "${filtered_array[*]}") | ||
|
||
# Build full regex string | ||
regex="(.*-(alpha|beta).*|$joined_string)" | ||
echo "Regex: $regex" | ||
|
||
github_changelog_generator -u department-of-veterans-affairs -p va-mobile-library -t $token --exclude-tags-regex $regex --no-unreleased |
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 |
---|---|---|
|
@@ -84,14 +84,16 @@ jobs: | |
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_OUTPUT" | ||
echo "GIT_TAG=${{ inputs.package }}-v$NEW_VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Generate changelog, commit changes and tag | ||
- name: Generate changelog | ||
run: | | ||
chmod +x ../../.github/scripts/generate-changelog.sh | ||
./../../.github/scripts/generate-changelog.sh ${{ inputs.package }} ${{ secrets.VA_MOBILE_ROBOT_GITHUB_PAT }} | ||
- name: Commit changes and tag | ||
run: | | ||
git config --global user.name 'VA Automation Bot' | ||
git config --global user.email '[email protected]' | ||
git pull | ||
git add package.json | ||
cd ../../ | ||
bundle exec github_changelog_generator -u department-of-veterans-affairs -p va-mobile-library -t ${{ secrets.VA_MOBILE_ROBOT_GITHUB_PAT }} --exclude-tags-regex ".*-(alpha|beta).*" | ||
git add CHANGELOG.md | ||
git commit -m 'Version bump: ${{ steps.bump-version.outputs.GIT_TAG }}' | ||
git push | ||
|