Skip to content

Commit c0c45f1

Browse files
committed
Fix branch filters and tag cleanup for feature branches
1 parent aaec36f commit c0c45f1

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ name: Test, Build, Deploy
33
on:
44
push:
55
branches:
6-
- '*'
6+
- '**'
77
paths:
88
- 'src/**'
99
- 'docker/**'
1010
- '.github/workflows/build.yml'
1111
pull_request:
1212
branches:
13-
- '*'
13+
- '**'
1414
paths:
1515
- 'src/**'
1616
- 'docker/**'
1717
- '.github/workflows/build.yml'
1818
workflow_dispatch:
1919
create:
2020
branches:
21-
- '*'
21+
- '**'
2222

2323
permissions:
2424
contents: read

.github/workflows/delete.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Branch Delete
33
on:
44
delete:
55
branches:
6-
- '*'
6+
- '**'
77

88
permissions:
99
contents: read
@@ -26,8 +26,10 @@ jobs:
2626
run: |
2727
# Use jq to extract the branch name from the event payload
2828
BRANCH=$(cat ${{ github.event_path }} | jq --raw-output '.ref' | sed 's/refs\/heads\///')
29-
# Convert branch name to lowercase
29+
# Normalize to the same Docker-safe tag format used by build.yml
3030
BRANCH_NAME=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]')
31+
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -E 's/[^a-z0-9._-]+/-/g; s/^-+//; s/-+$//; s/^[.]+//; s/[.]+$//; s/-{2,}/-/g')
32+
BRANCH_NAME="${BRANCH_NAME:0:120}"
3133
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
3234
3335
- name: Remove Docker image

0 commit comments

Comments
 (0)