Skip to content

Conversation

@mgoltzsche
Copy link
Contributor

@mgoltzsche mgoltzsche commented Oct 6, 2025

...instead of supporting only the short form syntax ({owner}/{repo})

Additional changes:

  • Allow cloning from arbitrary SSH URL instead of conditionally letting the action generate the SSH URL from the given short form URL internally.
  • Fix a bug where an invalid commit-url output value was generated when cloning a repository from Bitbucket Datacenter (the workflow originating SCM provider URL was always used as base URL instead of using the bitbucket-server-url value and there was a missing slash).

@mgoltzsche mgoltzsche requested a review from a team as a code owner October 6, 2025 15:57
@mgoltzsche mgoltzsche marked this pull request as draft October 6, 2025 15:57
@mgoltzsche mgoltzsche marked this pull request as ready for review October 7, 2025 18:48
@mgoltzsche mgoltzsche requested a review from stephenc October 7, 2025 19:07
...instead of supporting only short form syntax (`{owner}/{repo}`)
Fixes a bug where the workflow originating repository URL was used to generate the `commit-url` output when the SCM `provider` was set to `bitbucket_datacenter` instead of using the `bitbucket-server-url` in that case.
@mgoltzsche
Copy link
Contributor Author

mgoltzsche commented Oct 8, 2025

I rebased the PR now to include #41.

@mgoltzsche mgoltzsche requested a review from pinaki124 October 8, 2025 12:45
@mgoltzsche mgoltzsche force-pushed the cbp-18302 branch 2 times, most recently from bb8407a to 5c96473 Compare October 8, 2025 17:34
@mgoltzsche
Copy link
Contributor Author

mgoltzsche commented Oct 8, 2025

While e2e testing the action I realized that the logic that uses the commit SHA the workflow originates from as commit SHA of the repo to checkout by default when the checkout action's repository value is equal to the one within the SCM event (the one the workflow originates from) broke since the event may contain the repository URL in a different format. Thus, the repository URL from the SCM event also needs to be normalized before comparing it to the one within the repository action input...

I'll also add corresponding e2e tests to the workflow within this repository...

@mgoltzsche mgoltzsche marked this pull request as draft October 8, 2025 20:21
Don't modify the original repository input value when normalizing it but store the normalized representation within a separate internal field.
This is so that the logic that derives the ref from the event when the repository input value equals the one within the event does not break.
@mgoltzsche mgoltzsche marked this pull request as ready for review October 9, 2025 18:43
@mgoltzsche mgoltzsche requested a review from pinaki124 October 9, 2025 18:43
@mgoltzsche
Copy link
Contributor Author

Instead of normalizing the repo URL from the SCM event before comparing it with the repository input, I made the code not modify the repository input in the first place since the default will always equals the value from the SCM event. To have the initial validation and input normalization logic testable using the new set of tests, I added an internal repositoryCloneURL field which holds the normalized version of the repository input from where the code obtains it subsequently where appropriate.

...by adding a missing slash in front of the path
@mgoltzsche mgoltzsche merged commit 389b10a into main Oct 9, 2025
2 checks passed
@mgoltzsche mgoltzsche deleted the cbp-18302 branch October 23, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants