Skip to content

Commit acea20c

Browse files
authored
Add GitLab CI/CD support to publish notifications (#12312)
Show "by GitLab CI/CD" with job URL when package is published via GitLab trusted publishing
1 parent 8358ada commit acea20c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/tests/krate/publish/snapshots/integration__krate__publish__trustpub_gitlab__full_flow-11.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Content-Transfer-Encoding: quoted-printable
5151

5252
Hello foo!
5353

54-
A new version of foo crate was published at [0000-00-00T00:00:00Z].
54+
A new version of foo crate was published by GitLab CI/CD (https://gitlab.com/rust-lang/foo-rs/-/jobs/11530106120) at [0000-00-00T00:00:00Z].
5555

5656
View v1.1.0 here: https://crates.io/crates/foo/1.1.0
5757

src/worker/jobs/send_publish_notifications.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ impl BackgroundJob for SendPublishNotificationsJob {
9797
) => &format!(
9898
" by GitHub Actions (https://github.com/{repository}/actions/runs/{run_id})",
9999
),
100+
(
101+
_,
102+
Some(TrustpubData::GitLab {
103+
project_path,
104+
job_id,
105+
..
106+
}),
107+
) => {
108+
&format!(" by GitLab CI/CD (https://gitlab.com/{project_path}/-/jobs/{job_id})")
109+
}
100110
_ => "",
101111
};
102112

0 commit comments

Comments
 (0)