Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Changes for dependabot to be well-behaved #1165

Merged
merged 16 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 13 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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
labels:
- "dependencies"
commit-message:
prefix: "chore"
prefix: "bot"
1 change: 0 additions & 1 deletion .github/workflows/validate-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Checkout code into the directory
uses: actions/checkout@v3

Expand Down
20 changes: 14 additions & 6 deletions tools/configs/chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ info:
repository_url: https://github.com/sourcenetwork/defradb
options:
commits:
filters:
Type:
- feat
- fix
- perf
- refactor
filters:
shahzadlone marked this conversation as resolved.
Show resolved Hide resolved
Type:
- feat
- fix
- tools
- docs
- perf
- refactor
- test
- ci
- chore
- bot
commit_groups:
title_maps:
feat: Features
Expand All @@ -21,6 +27,7 @@ options:
refactor: Refactoring
test: Testing
ci: Continuous integration
bot: Bot
sort_by: Custom
title_order:
- feat
Expand All @@ -32,6 +39,7 @@ options:
- test
- ci
- chore
- bot
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
Expand Down
4 changes: 4 additions & 0 deletions tools/scripts/scripts_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ TestReturnCode "${T1} 'perf: This is a valid title'" 0;
TestReturnCode "${T1} 'refactor: This is a valid title'" 0;
TestReturnCode "${T1} 'test: This is a valid title'" 0;
TestReturnCode "${T1} 'tools: This is a valid title'" 0;
TestReturnCode "${T1} 'bot: Bump github.com/alternativesourcenetwork/defradb from 1.1.0.1.0.0 to 1.1.0.1.0.1'" 0
TestReturnCode "${T1} 'bot: Bump github.com/alternativesourcenetwork/defradb from 1.1.0.1.0.0 to 1.1.0.1.0.1'" 0
TestReturnCode "${T1} 'bot: Bump github.com/alternativesourcenetwork/defradb from 1.1.0.1.0.0 to 1.1.0.1.0.1'" 0
orpheuslummis marked this conversation as resolved.
Show resolved Hide resolved
TestReturnCode "${T1} 'chore: Update dependencies manually github.com/thisistoolong/topass from 1.1.0.1 1.0.1.2'" 3
orpheuslummis marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 12 additions & 2 deletions tools/scripts/validate-conventional-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,27 @@ readonly -a VALID_LABELS=("chore"
"perf"
"refactor"
"test"
"tools");
"tools"
"bot");

BOTPREFIX="bot"

if [ "${#}" -ne 1 ]; then
printf "Error: Invalid number of arguments (pass title as 1 string argument).\n";
exit 2;
fi

TITLE=${1};
IS_BOT=false;

# Detect if title is prefixed with `bot`
if [[ "${TITLE}" =~ ^"${BOTPREFIX}" ]]; then
orpheuslummis marked this conversation as resolved.
Show resolved Hide resolved
printf "Info: Title is from a bot, skipping length-related title validation.\n";
IS_BOT=true;
fi

# Validate that the entire length of the title is less than or equal to our character limit.
if [ "${#TITLE}" -gt 60 ]; then
if [ "${#TITLE}" -gt 60 ] && [ "${IS_BOT}" = false ]; then
printf "Error: The length of the title is too long (should be 60 or less).\n";
exit 3;
fi
Expand Down