Skip to content

Commit 2be0d0d

Browse files
committed
chore(dependabot): releaserc to be used in checks and dependabot not to be failed by it
1 parent d728264 commit 2be0d0d

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ updates:
66
interval: "daily"
77
open-pull-requests-limit: 100
88
target-branch: "Automatic_version_update_dependabot"
9+
rebase-strategy: "auto"
910

1011
- package-ecosystem: "npm"
1112
directory: "/"
1213
schedule:
1314
interval: "daily"
1415
open-pull-requests-limit: 100
1516
target-branch: "Automatic_version_update_dependabot"
16-
17-
17+
rebase-strategy: "auto"

.github/workflows/reuseable-ci-checks.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,45 @@ jobs:
145145
#BRANCH_NAME="${GITHUB_HEAD_REF}"
146146
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
147147
echo "Validating branch name: $BRANCH_NAME"
148+
149+
# Read allowed branch patterns from .releaserc.json
150+
ALLOWED_BRANCHES=$(jq -r '.branches[].name' .releaserc.json)
151+
152+
VALID=false
153+
for pattern in $ALLOWED_BRANCHES; do
154+
# Convert wildcard * into regex
155+
REGEX="^${pattern//\*/.*}$"
156+
if [[ "$BRANCH_NAME" =~ $REGEX ]]; then
157+
VALID=true
158+
break
159+
fi
160+
done
161+
162+
# Always allow dependabot branches for CI
163+
# Semver will ignore the branch but will bump the collected dependabot changes branch
164+
if [[ "$BRANCH_NAME" =~ ^dependabot/ ]]; then
165+
echo "✅ Branch is a dependabot branch its not for release or versioning but for merging into the dependabot collection branch"
166+
VALID=true
167+
fi
148168
149-
if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]]; then
169+
if [ "$VALID" = true ]; then
150170
echo "✅ Branch name is valid"
151171
else
152172
echo "❌ Invalid branch name: $BRANCH_NAME"
153-
echo "Branch names must follow one of the allowed prefixes:"
154-
echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*"
173+
echo "Allowed branch patterns:"
174+
echo "$ALLOWED_BRANCHES"
155175
exit 1
156176
fi
177+
178+
# qqqq drop
179+
# if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]]; then
180+
# echo "✅ Branch name is valid"
181+
# else
182+
# echo "❌ Invalid branch name: $BRANCH_NAME"
183+
# echo "Branch names must follow one of the allowed prefixes:"
184+
# echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*"
185+
# exit 1
186+
# fi
157187

158188

159189
reuseable-ci-checks-commitlint:

0 commit comments

Comments
 (0)