Added fortinet.fortios
collection to requirements
#71
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
name: Updating collection version, git tag and release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version_collection_and_tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Configuring collection & tag versions | |
run: | | |
target_file="nova/core/galaxy.yml" | |
# Configuring git | |
git config --global user.name "Nova CI" | |
git config --global user.email "[email protected]" | |
# Updating the version in the galaxy.yml file | |
version_row_old=$(grep "version: " $target_file) | |
version=$(echo $version_row_old | cut -d: -f2) | |
major=$(echo $version | cut -d. -f1) | |
minor=$(echo $version | cut -d. -f2) | |
patch=$(echo $version | cut -d. -f3) | |
patch_new=$(( $patch+1 )) | |
version_row_new="version: $major.$minor.$patch_new" | |
sed -i "s/$version_row_old/$version_row_new/" $target_file | |
TAG_NAME="v$major.$minor.$patch_new" | |
echo "LATEST_TAG=$TAG_NAME" >> $GITHUB_ENV | |
# Adding the changed file to git | |
git add $target_file | |
# Committing the change | |
git commit -m "Set nova.core collection version to $major.$minor.$patch_new" | |
git push | |
# Tagging and pushing the change | |
git tag $TAG_NAME | |
git push origin $TAG_NAME | |
# Creating temp changelog file | |
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^^)..HEAD > CHANGELOG.md | |
- uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.LATEST_TAG }} | |
bodyFile: CHANGELOG.md |