Skip to content

Commit 225bee9

Browse files
authored
chore(uikit preview releae): validate preview branch name in workflow (#3000)
1 parent 6f1d62d commit 225bee9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/preview-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
3131
token: ${{ steps.generate_github_token.outputs.token }}
3232

33+
- name: Validate branch name
34+
run: |
35+
BRANCH_NAME=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
36+
if [[ ! "$BRANCH_NAME" =~ ^preview/[a-zA-Z0-9_-]+$ ]]; then
37+
echo "Ignoring PR because of the branch name. Exiting workflow."
38+
exit 1
39+
fi
40+
3341
- name: Setup Node (uses version in .nvmrc)
3442
uses: actions/setup-node@v4
3543
with:

0 commit comments

Comments
 (0)