Skip to content

trustpub: Show "Trusted Publishing" crate settings for everyone #11532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 39 additions & 42 deletions app/templates/crate/settings/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,51 +54,48 @@
{{/each}}
</div>

{{! The "Trusted Publishing" section is hidden for now until we make this feature publicly available. }}
{{#if this.githubConfigs}}
<div local-class="header">
<h2>Trusted Publishing</h2>
<div>
<LinkTo @route="docs.trusted-publishing" class="button button--tan button--small" data-test-trusted-publishing-docs-button>
Learn more
</LinkTo>
<LinkTo @route="crate.settings.new-trusted-publisher" class="button button--small" data-test-add-trusted-publisher-button>
Add
</LinkTo>
</div>
<div local-class="header">
<h2>Trusted Publishing</h2>
<div>
<LinkTo @route="docs.trusted-publishing" class="button button--tan button--small" data-test-trusted-publishing-docs-button>
Learn more
</LinkTo>
<LinkTo @route="crate.settings.new-trusted-publisher" class="button button--small" data-test-add-trusted-publisher-button>
Add
</LinkTo>
</div>
</div>

<table local-class="trustpub" data-test-trusted-publishing>
<thead>
<tr>
<th>Publisher</th>
<th>Details</th>
<th></th>
<table local-class="trustpub" data-test-trusted-publishing>
<thead>
<tr>
<th>Publisher</th>
<th>Details</th>
<th><span class="sr-only">Actions</span></th>
</tr>
</thead>
<tbody>
{{#each this.githubConfigs as |config|}}
<tr data-test-github-config={{config.id}}>
<td>GitHub</td>
<td local-class="details">
<strong>Repository:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}" target="_blank" rel="noopener noreferrer">{{config.repository_owner}}/{{config.repository_name}}</a><br>
<strong>Workflow:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}/blob/HEAD/.github/workflows/{{config.workflow_filename}}" target="_blank" rel="noopener noreferrer">{{config.workflow_filename}}</a><br>
{{#if config.environment}}
<strong>Environment:</strong> {{config.environment}}
{{/if}}
</td>
<td local-class="actions">
<button type="button" class="button button--small" data-test-remove-config-button {{on "click" (perform this.removeConfigTask config)}}>Remove</button>
</td>
</tr>
</thead>
<tbody>
{{#each this.githubConfigs as |config|}}
<tr data-test-github-config={{config.id}}>
<td>GitHub</td>
<td local-class="details">
<strong>Repository:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}" target="_blank" rel="noopener noreferrer">{{config.repository_owner}}/{{config.repository_name}}</a><br>
<strong>Workflow:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}/blob/HEAD/.github/workflows/{{config.workflow_filename}}" target="_blank" rel="noopener noreferrer">{{config.workflow_filename}}</a><br>
{{#if config.environment}}
<strong>Environment:</strong> {{config.environment}}
{{/if}}
</td>
<td local-class="actions">
<button type="button" class="button button--small" data-test-remove-config-button {{on "click" (perform this.removeConfigTask config)}}>Remove</button>
</td>
</tr>
{{else}}
<tr data-test-no-config>
<td colspan="3">No trusted publishers configured for this crate.</td>
</tr>
{{/each}}
</tbody>
</table>
{{/if}}
{{else}}
<tr data-test-no-config>
<td colspan="3">No trusted publishers configured for this crate.</td>
</tr>
{{/each}}
</tbody>
</table>

<h2 local-class="header">Danger Zone</h2>

Expand Down
8 changes: 3 additions & 5 deletions e2e/routes/crate/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ test.describe('Route | crate.settings', { tag: '@routes' }, () => {
await expect(page.locator(`[data-test-owner-user="${user.login}"]`)).toBeVisible();
await expect(page.locator('[data-test-remove-owner-button]')).toBeVisible();

// Disabled for now, until we make this feature publicly available
// await expect(page.locator('[data-test-trusted-publishing]')).toBeVisible();
// await expect(page.locator('[data-test-no-config]')).toBeVisible();
// await expect(page.locator('[data-test-github-config]')).not.toBeVisible();
await expect(page.locator('[data-test-trusted-publishing]')).not.toBeVisible();
await expect(page.locator('[data-test-trusted-publishing]')).toBeVisible();
await expect(page.locator('[data-test-no-config]')).toBeVisible();
await expect(page.locator('[data-test-github-config]')).not.toBeVisible();

await expect(page.locator('[data-test-delete-button]')).toBeVisible();
});
Expand Down
8 changes: 3 additions & 5 deletions tests/routes/crate/settings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ module('Route | crate.settings', hooks => {
assert.dom(`[data-test-owner-user="${user.login}"]`).exists();
assert.dom('[data-test-remove-owner-button]').exists();

// Disabled for now, until we make this feature publicly available
// assert.dom('[data-test-trusted-publishing]').exists();
// assert.dom('[data-test-no-config]').exists();
// assert.dom('[data-test-github-config]').doesNotExist();
assert.dom('[data-test-trusted-publishing]').doesNotExist();
assert.dom('[data-test-trusted-publishing]').exists();
assert.dom('[data-test-no-config]').exists();
assert.dom('[data-test-github-config]').doesNotExist();

assert.dom('[data-test-delete-button]').exists();
});
Expand Down
Loading