diff --git a/.github/workflows/auto_label.yml b/.github/workflows/auto_label.yml new file mode 100644 index 000000000..75b40e5da --- /dev/null +++ b/.github/workflows/auto_label.yml @@ -0,0 +1,21 @@ +name: :rocket: to adjust + +on: + pull_request: + +permissions: + pull-requests: write + contents: read + +jobs: + conventional-commits: + if: (!contains(split('foo,bar', ','), github.actor)) + name: Report Conventional Commits + runs-on: ubuntu-latest + steps: + - name: Report Conventional Commits + uses: nichtsfrei/actions/pr-conventional-commit-labeler@v3 + with: + token: ${{ github.token }} + configuration_toml: release_tag.toml + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a128693b2..8398bd82a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,6 +66,7 @@ jobs: with: token: ${{ secrets.token }} fetch-depth: '0' + - name: set git credentials run: | git config --global user.email "${{ secrets.email }}" @@ -77,15 +78,13 @@ jobs: git checkout "v${{ env.LATEST_VERSION }}" # get just the major version of latest version export BRANCH_NAME=$(echo "${{ env.LATEST_VERSION }}" | sed 's/^\([0-9]*\).*/v\1/') - git checkout -b "$BRANCH_NAME" - git push origin "$BRANCH_NAME" + git checkout -b "$BRANCH_NAME" && git push origin "$BRANCH_NAME" || true # create branch of version + - uses: greenbone/actions/setup-pontos@v3 - name: prepare project version ${{ env.RELEASE_REF }} ${{ env.LATEST_VERSION }} -> ${{ env.NEW_VERSION }} run: | # jump back for the case that we switched to a tag git checkout "${{ env.RELEASE_REF }}" - # change version - python3 -m pip install pontos # ignore failure on setting version pontos-version update ${{ env.NEW_VERSION }} || true # set app version on chart @@ -107,7 +106,6 @@ jobs: with: name: rs-binaries path: assets - - uses: greenbone/actions/setup-pontos@v3 - name: release ${{ env.PROJECT }} ${{ env.LATEST_VERSION }} -> ${{ env.NEW_VERSION }} run: | pontos-changelog \ diff --git a/release_tag.toml b/release_tag.toml new file mode 100644 index 000000000..35c8e753a --- /dev/null +++ b/release_tag.toml @@ -0,0 +1,22 @@ +# the name functions as a key and should be unique. +# The priority is used when only_highest_priority is set to true +labels = [ + { name = "patch_release", priority = 1 }, + { name = "minor_release", priority = 2 }, + { name = "major_release", priority = 3 }, +] + +# group within groups must be defined in `changelog.toml` +# label within groups must be defined in `labels` +groups = [ + { group = "Added", label = "minor_release" }, + { group = "Changed", label = "major_release" }, # maybe minor? + { group = "Removed", label = "major_release" }, # maybe minor? + { group = "Bug Fixes", label = "patch_reelase" }, +] + +# when set to false all unique labels will be set +# otherwise only one label with the highest priority +# will be set +only_highest_priority = true +