diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f92c961..ccc161f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,12 +6,19 @@ on: description: "The branch to use to release from." required: true default: "main" + jobs: release: name: Release to Maven Central runs-on: ubuntu-20.04 steps: + - name: Check if branch is main + if: github.event.inputs.branch != 'main' + run: | + echo "This workflow can only run from the 'main' branch." + exit 1 + - name: Checkout source code uses: actions/checkout@v2 with: @@ -47,4 +54,4 @@ jobs: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} - GPG_PASSPHRASE: ${{secrets.GPG_PRIVATE_KEY_PASSPHRASE}} + GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}