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

GitHub Actions Naming Scheme #1011

Merged
merged 156 commits into from
Nov 24, 2024
Merged

Conversation

PhilippSchmelter
Copy link
Contributor

@PhilippSchmelter PhilippSchmelter commented Oct 29, 2024

Solves #1010
Merge #982 First!!!!!!

@sebastian-peter
Copy link
Member

By the way, it'd be great if you could implement the branch naming check in a gradle task. Parameters can be passed to gradle tasks like so

build.gradle Outdated Show resolved Hide resolved
gradle/scripts/BranchName.gradle Outdated Show resolved Hide resolved
gradle/scripts/BranchName.gradle Outdated Show resolved Hide resolved
gradle/scripts/BranchName.gradle Outdated Show resolved Hide resolved
gradle/scripts/BranchName.gradle Outdated Show resolved Hide resolved
gradle/scripts/BranchName.gradle Outdated Show resolved Hide resolved
Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I just realized... The check will fail in dev, main and release branches.

You can get a hint of what is needed in Jenkinsfile:

simona/Jenkinsfile

Lines 666 to 671 in 741a2b2

def dev_pattern = "^(developer|develop|dev)\$"
def release_pattern = ".*rel/.*"
def feature_pattern = "^\\pL{2}/#\\d+.*"
def dependabot_pattern = "^dependabot/.*\$"
def hotfix_pattern = ".*hotfix/\\pL{2}/#\\d+.*"
def main_pattern = ".*main"

@PhilippSchmelter
Copy link
Contributor Author

Something I just realized... The check will fail in dev, main and release branches.

You can get a hint of what is needed in Jenkinsfile:

simona/Jenkinsfile

Lines 666 to 671 in 741a2b2

def dev_pattern = "^(developer|develop|dev)\$"
def release_pattern = ".*rel/.*"
def feature_pattern = "^\\pL{2}/#\\d+.*"
def dependabot_pattern = "^dependabot/.*\$"
def hotfix_pattern = ".*hotfix/\\pL{2}/#\\d+.*"
def main_pattern = ".*main"

I think the newest commit will implement the needed functionality

@PhilippSchmelter
Copy link
Contributor Author

Had some problems with spotless. Now it should really work for all kinds our branches..
This pull request introduces a new Gradle task to validate branch names and integrates this validation into the CI workflow. The key changes are:

CI Workflow Enhancements:

  • .github/workflows/ci.yml: Added a step to check the branch name format during the CI process. This step determines the branch name based on the event type and then runs the new Gradle task to validate it.

Gradle Task Addition:

  • gradle/scripts/branchName.gradle: Introduced a new Gradle task checkBranchName that validates the branch name against a set of predefined patterns. If the branch name does not match any pattern, an error is thrown.

Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@sebastian-peter sebastian-peter merged commit a405fed into dev Nov 24, 2024
4 checks passed
@sebastian-peter sebastian-peter deleted the ps/#939-GitHubActionsNamingScheme branch November 24, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to continuous integration enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming-convention Check for new GitHub Actions Pipeline
2 participants