You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<strong>Optional:</strong> For enhanced security, create a GitHub Actions environment named "release"
89
+
in your repository settings with protection rules like required reviewers or deployment branches.
90
+
</p>
91
+
92
+
<h2>Security & Best Practices</h2>
93
+
<ul>
94
+
<li><strong>Use specific workflow filenames</strong> to reduce the attack surface</li>
95
+
<li><strong>Use GitHub Actions environments</strong> with protection rules for sensitive publishing</li>
96
+
<li><strong>Limit workflow triggers</strong> to specific tags or protected branches</li>
97
+
<li><strong>Review all actions used</strong> in your release workflow</li>
98
+
<li><strong>Monitor publishing activities</strong> through crates.io email notifications</li>
99
+
</ul>
100
+
101
+
<p>
102
+
<strong>How it works:</strong> GitHub Actions generates an OIDC token that proves your workflow's identity.
103
+
The <code>rust-lang/crates-io-auth-action</code> exchanges this for a 30-minute access token that
104
+
<code>cargo publish</code> uses automatically.
105
+
</p>
106
+
107
+
<h2>Migration from API Tokens</h2>
108
+
<p>
109
+
To migrate from API tokens: set up Trusted Publishing following the steps above, test it,
110
+
then remove the API token from your repository secrets. Both methods can be used simultaneously during transition.
111
+
</p>
112
+
113
+
<h2>Additional Resources</h2>
114
+
<ul>
115
+
<li><ahref="https://rust-lang.github.io/rfcs/3691-trusted-publishing-cratesio.html">RFC 3691: Trusted Publishing for crates.io</a></li>
116
+
<li><ahref="https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect">GitHub: About security hardening with OpenID Connect</a></li>
117
+
<li><ahref="https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment">GitHub: Using environments for deployment</a></li>
0 commit comments