Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
To only push from Master branch
  • Loading branch information
HamzaJugon authored Oct 21, 2024
1 parent eabe909 commit 7069203
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
description: "The branch to use to release from."
required: true
default: "main"

jobs:
release:
name: Release to Maven Central
Expand All @@ -19,6 +20,12 @@ jobs:
ref: ${{ github.event.inputs.branch }}
# We need a personal access token to be able to push to a protected branch
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- name: Ensure release is from the main branch
if: ${{ github.event.inputs.branch != 'main' }}
run: |
echo "Releases can only be made from the main branch. Exiting."
exit 1
- name: Set up JDK
uses: actions/setup-java@v2
Expand Down

0 comments on commit 7069203

Please sign in to comment.