Skip to content

Commit 8cc55c1

Browse files
committed
Replace config field list with GitHub URLs in trustpub emails
Replaces the bulleted list of configuration fields (repository owner, repository name, workflow filename, environment) with prose containing direct GitHub URLs to the workflow file and environment page. For config created emails: - Link to workflow file at `github.com/{owner}/{repo}/blob/main/.github/workflows/{filename}` - When environment is set, also link to `github.com/{owner}/{repo}/deployments/{environment}` For config deleted emails: - Link to workflow file - When environment is set, mention environment name inline without URL This makes it immediately clear what workflow is authorized and provides one-click access to view the workflow file and environment configuration.
1 parent bc99b78 commit 8cc55c1

8 files changed

+13
-48
lines changed

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_created_email-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello octocat!
66

77
You added a new "Trusted Publishing" configuration for GitHub Actions to your crate "my-crate". Trusted publishers act as trusted users and can publish new versions of the crate automatically.
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: (not set)
9+
This configuration allows the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml to publish new versions of this crate.
1510

1611
If you did not make this change and you think it was made maliciously, you can remove the configuration from the crate via the "Settings" tab on the crate's page.
1712

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_created_email_different_recipient-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello team-member!
66

77
crates.io user octocat added a new "Trusted Publishing" configuration for GitHub Actions to a crate that you manage ("my-crate"). Trusted publishers act as trusted users and can publish new versions of the crate automatically.
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: (not set)
9+
This configuration allows the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml to publish new versions of this crate.
1510

1611
If you did not make this change and you think it was made maliciously, you can remove the configuration from the crate via the "Settings" tab on the crate's page.
1712

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_created_email_with_environment-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello octocat!
66

77
You added a new "Trusted Publishing" configuration for GitHub Actions to your crate "my-crate". Trusted publishers act as trusted users and can publish new versions of the crate automatically.
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: production
9+
This configuration allows the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml to publish new versions of this crate. The workflow must use the `production` environment (https://github.com/rust-lang/rust/deployments/production).
1510

1611
If you did not make this change and you think it was made maliciously, you can remove the configuration from the crate via the "Settings" tab on the crate's page.
1712

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_deleted_email-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello octocat!
66

77
You removed a "Trusted Publishing" configuration for GitHub Actions from your crate "my-crate".
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: (not set)
9+
The removed configuration was for the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml.
1510

1611
If you did not make this change and you think it was made maliciously, you can email help@crates.io for assistance.
1712

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_deleted_email_different_recipient-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello team-member!
66

77
crates.io user octocat removed a "Trusted Publishing" configuration for GitHub Actions from a crate that you manage ("my-crate").
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: (not set)
9+
The removed configuration was for the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml.
1510

1611
If you did not make this change and you think it was made maliciously, you can email help@crates.io for assistance.
1712

src/controllers/trustpub/snapshots/crates_io__controllers__trustpub__emails__tests__config_deleted_email_with_environment-2.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ Hello octocat!
66

77
You removed a "Trusted Publishing" configuration for GitHub Actions from your crate "my-crate".
88

9-
Trusted Publishing configuration:
10-
11-
- Repository owner: rust-lang
12-
- Repository name: rust
13-
- Workflow filename: publish.yml
14-
- Environment: production
9+
The removed configuration was for the workflow file at https://github.com/rust-lang/rust/blob/main/.github/workflows/publish.yml using the `production` environment.
1510

1611
If you did not make this change and you think it was made maliciously, you can email help@crates.io for assistance.
1712

src/email/templates/trustpub_config_created/body.txt.j2

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ You added a new "Trusted Publishing" configuration for GitHub Actions to your cr
99
crates.io user {{ auth_user.gh_login }} added a new "Trusted Publishing" configuration for GitHub Actions to a crate that you manage ("{{ krate.name }}"). Trusted publishers act as trusted users and can publish new versions of the crate automatically.
1010
{%- endif %}
1111

12-
Trusted Publishing configuration:
13-
14-
- Repository owner: {{ saved_config.repository_owner }}
15-
- Repository name: {{ saved_config.repository_name }}
16-
- Workflow filename: {{ saved_config.workflow_filename }}
17-
- Environment: {{ saved_config.environment or "(not set)" }}
12+
This configuration allows the workflow file at https://github.com/{{ saved_config.repository_owner }}/{{ saved_config.repository_name }}/blob/main/.github/workflows/{{ saved_config.workflow_filename }} to publish new versions of this crate.
13+
{%- if saved_config.environment %} The workflow must use the `{{ saved_config.environment }}` environment (https://github.com/{{ saved_config.repository_owner }}/{{ saved_config.repository_name }}/deployments/{{ saved_config.environment }}).
14+
{%- endif %}
1815

1916
If you did not make this change and you think it was made maliciously, you can remove the configuration from the crate via the "Settings" tab on the crate's page.
2017

src/email/templates/trustpub_config_deleted/body.txt.j2

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ You removed a "Trusted Publishing" configuration for GitHub Actions from your cr
99
crates.io user {{ auth_user.gh_login }} removed a "Trusted Publishing" configuration for GitHub Actions from a crate that you manage ("{{ krate.name }}").
1010
{%- endif %}
1111

12-
Trusted Publishing configuration:
13-
14-
- Repository owner: {{ config.repository_owner }}
15-
- Repository name: {{ config.repository_name }}
16-
- Workflow filename: {{ config.workflow_filename }}
17-
- Environment: {{ config.environment or "(not set)" }}
12+
The removed configuration was for the workflow file at https://github.com/{{ config.repository_owner }}/{{ config.repository_name }}/blob/main/.github/workflows/{{ config.workflow_filename }}
13+
{%- if config.environment %} using the `{{ config.environment }}` environment
14+
{%- endif -%}
15+
.
1816

1917
If you did not make this change and you think it was made maliciously, you can email [email protected] for assistance.
2018
{% endblock %}

0 commit comments

Comments
 (0)