Skip to content

Update gitstream.cm #25

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

Merged
merged 7 commits into from
Oct 12, 2024
Merged

Conversation

conorbronsdon
Copy link
Owner

In this version:

We're still using a custom expression called branch_prefix. The expression now uses branch.find('/') to locate the first slash. If a slash is found, it takes everything before it. If not, it uses the whole branch name.

This approach avoids using the split() function, which might be causing issues.

In this version:

We're still using a custom expression called branch_prefix.
The expression now uses branch.find('/') to locate the first slash.
If a slash is found, it takes everything before it. If not, it uses the whole branch name.

This approach avoids using the split() function, which might be causing issues.
Testing gitStream functions to validate capabilities in order to rebuild branch labeling function
This configuration does the following:

It still always runs (condition is true).
It adds a label that includes the word "branch-" followed by the full branch name.

This step introduces the use of the branch variable within a Jinja2 expression, but doesn't yet attempt to manipulate the branch name.
This configuration does the following:

It still always runs (condition is true).
It uses the split filter to divide the branch name at the '/' character.
It then uses the first filter to select the first part of the split result.

This should add a label that's just the first part of the branch name (e.g., "feature" for a branch named "feature/new-login").
In this configuration:

We've moved the string manipulation logic to a custom expression called branch_prefix.
The custom expression uses Python-like indexing ([0]) to get the first element after splitting.
We've added a conditional to handle cases where there's no '/' in the branch name.
In the automation, we simply reference the custom expression.
This configuration does the following:

It uses the branch_prefix custom expression we developed to add a label based on the first part of the branch name.
It introduces a new custom expression is_hotfix to check if the branch name starts with "hotfix/".
It adds a second add-label action that will add an "urgent" label if is_hotfix is true.
@conorbronsdon conorbronsdon merged commit 8a70ff3 into conorbronsdon-patch-11 Oct 12, 2024
3 checks passed
@conorbronsdon conorbronsdon deleted the conorbronsdon-patch-12 branch October 12, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant