Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .github/workflows/publish-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check branch protection
env:
RELEASE_TYPE: ${{ github.event.inputs.releaseType }}
REF_NAME: ${{ github.ref_name }}
run: |
if [ "$RELEASE_TYPE" = "dry-run" ]; then
if [ "${{ github.event.inputs.releaseType }}" == "dry-run" ]; then
echo "✅ Branch check skipped: dry-run mode allows any branch"
echo "Current branch: $REF_NAME"
echo "Current branch: ${{ github.ref_name }}"
exit 0
fi
case "$REF_NAME" in
main|hotfix/*)
echo "✅ Branch check passed: workflow is running from allowed branch ($REF_NAME)"
;;
*)
echo "❌ This workflow can only be triggered from main or hotfix/* branches."
echo "Current branch: $REF_NAME"
exit 1
;;
esac
if [ "${{ github.ref_name }}" != "main" ]; then
echo "❌ This workflow can only be triggered from the main branch."
echo "Current branch: ${{ github.ref_name }}"
exit 1
fi
echo "✅ Branch check passed: workflow is running from main"

- name: ${{ github.actor }} permission check to do a release
uses: 'lannonbr/repo-permission-check-action@2bb8c89ba8bf115c4bfab344d6a6f442b24c9a1f'
Expand Down
Loading