{% extends "base.txt.j2" %}

{% if saved_config.type == "GitHub" %}
    {% set ci_provider = "GitHub Actions" %}
{% elif saved_config.type == "GitLab" %}
    {% set ci_provider = "GitLab CI" %}
{% endif %}

{% block content %}
Hello {{ recipient }}!

{% if recipient == auth_user.gh_login -%}
You added a new "Trusted Publishing" configuration for {{ ci_provider }} to your crate "{{ krate.name }}". Trusted publishers act as trusted users and can publish new versions of the crate automatically.
{%- else -%}
crates.io user {{ auth_user.gh_login }} added a new "Trusted Publishing" configuration for {{ ci_provider }} to a crate that you manage ("{{ krate.name }}"). Trusted publishers act as trusted users and can publish new versions of the crate automatically.
{%- endif %}

{% if saved_config.type == "GitHub" -%}
This configuration allows the workflow file at https://github.com/{{ saved_config.repository_owner }}/{{ saved_config.repository_name }}/blob/HEAD/.github/workflows/{{ saved_config.workflow_filename }} to publish new versions of this crate.
{%- 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 }}).
{%- endif %}
{% elif saved_config.type == "GitLab" -%}
This configuration allows the workflow file at https://gitlab.com/{{ saved_config.namespace }}/{{ saved_config.project }}/-/blob/HEAD/{{ saved_config.workflow_filepath }} to publish new versions of this crate.
{%- if saved_config.environment %} The workflow must use the `{{ saved_config.environment }}` environment.
{%- endif %}
{% endif %}
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.

If you are unable to revert the change and need to do so, you can email help@crates.io for assistance.
{% endblock %}
