Skip to content

Commit 257efa8

Browse files
authored
Merge pull request #11540 from Turbo87/trustpub-config-links
crate/settings: Add links back to the repository
2 parents c612a6a + 92b7727 commit 257efa8

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

app/controllers/crate/settings/new-trusted-publisher.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ export default class NewTrustedPublisherController extends Controller {
2727
return ['GitHub'];
2828
}
2929

30+
get repository() {
31+
if (this.repositoryOwner && this.repositoryName) {
32+
return `${this.repositoryOwner}/${this.repositoryName}`;
33+
}
34+
}
35+
3036
saveConfigTask = task(async () => {
3137
if (!this.validate()) return;
3238

app/templates/crate/settings/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
<tr data-test-github-config={{config.id}}>
8282
<td>GitHub</td>
8383
<td local-class="details">
84-
<strong>Repository:</strong> {{config.repository_owner}}/{{config.repository_name}}<br>
85-
<strong>Workflow:</strong> {{config.workflow_filename}}<br>
84+
<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>
85+
<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>
8686
{{#if config.environment}}
8787
<strong>Environment:</strong> {{config.environment}}
8888
{{/if}}

app/templates/crate/settings/new-trusted-publisher.hbs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,18 @@
106106
</div>
107107
{{else}}
108108
<div local-class="note">
109-
The filename of the publishing workflow. This file should be present in the <code>.github/workflows/</code> directory of the repository configured above. For example: <code>release.yml</code> or <code>publish.yml</code>.
109+
The filename of the publishing workflow. This file should be present in the
110+
<code>
111+
{{#if this.repository}}
112+
<a href="https://github.com/{{this.repository}}/blob/HEAD/.github/workflows/" target="_blank" rel="noopener noreferrer">.github/workflows/</a>
113+
{{else}}
114+
.github/workflows/
115+
{{/if}}
116+
</code>
117+
directory of the
118+
{{#if this.repository}}<a href="https://github.com/{{this.repository}}/" target="_blank" rel="noopener noreferrer">{{this.repository}}</a> {{/if}}
119+
repository{{unless this.repository " configured above"}}.
120+
For example: <code>release.yml</code> or <code>publish.yml</code>.
110121
</div>
111122
{{/if}}
112123
{{/let}}

0 commit comments

Comments
 (0)