Skip to content

Commit 0a15b69

Browse files
authored
oidc/gitlab: Support single-character workflow filenames (#18774)
1 parent d3f7cfd commit 0a15b69

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/unit/oidc/models/test_gitlab.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"gitlab.com/foo/bar//@[email protected]@/some/ref",
3737
3838
),
39+
("gitlab.com/foo/bar//a.yml@/some/ref", "a.yml"),
40+
("gitlab.com/foo/bar//a/b.yml@/some/ref", "a/b.yml"),
3941
# Malformed `ci_config_ref_uri`s.
4042
("gitlab.com/foo/bar//notnested.wrongsuffix@/some/ref", None),
4143
("gitlab.com/foo/bar//@/some/ref", None),

warehouse/oidc/models/gitlab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
# component of the claim.
3434
3535
( # our capture group
36-
.+ # match one or more of any character, including slashes
37-
[^/] # match at least one non-slash character, to prevent
36+
.* # match zero or more of any character, including slashes
37+
[^/] # match exactly one non-slash character, to prevent
3838
# empty basenames (e.g. `foo/.yml`)
3939
\.(yml|yaml) # match the literal suffix `.yml` or `.yaml`
4040
)

0 commit comments

Comments
 (0)