Skip to content

Commit

Permalink
fix: creation link
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed May 12, 2021
1 parent 6e1cb45 commit 7548ed2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ By commenting on this PR with: \`:rocket:[<pipeline>]\`, e.g.
| Comment | Description | More info |
| --- | --- | --- |
| \`:rocket:[a-pipeline]\` | | [:information_source:](https://example.com/does-templating-work?COMMITISH=c0ffeec0ffeec0ffeec0ffeec0ffeec0ffeec0ffeec0ffe&ORG=some-org&REPO=some-repo "See more information") |
| \`:rocket:[some-pipeline]\` | | [:heavy_plus_sign:](https://github.com/some-org/some-repo/new/master/.buildkite/pipeline/description/some-org?filename=some-pipeline.md&value=%23%20some-pipeline%0A%0A%5BDocument%20some-pipeline%27s%20RocketBot%20options%20here%5D "Add more information") |
| \`:rocket:[some-pipeline]\` | | [:heavy_plus_sign:](https://github.com/new/master?filename=.buildkite%2Fpipeline%2Fdescription%2Fsome-org%2Fsome-pipeline.md&value=%23+some-pipeline%0A%0A%5BDocument+some-pipeline%27s+RocketBot+options+here%5D "Add more information") |
| \`:rocket:[some-pipeline-lite]\` | This is a proper description with a \\| pipe | [:information_source:](https://github.com/some-org/some-repo/blob/master/.buildkite/pipeline/description/some-org/some-pipeline-lite.md "See more information") |
_Note: you can pass [custom environment variables](https://github.com/canva-public/rocketbot/blob/main/docs/guides/pass-in-variables.md) to some builds._
Expand Down
21 changes: 14 additions & 7 deletions src/initial_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,19 @@ function getDocumentationCreationLink(
orgSlug: string,
pipeline: Pipeline,
) {
return (
`https://github.com/${prData.head.repo.full_name}` +
`/new/${prData.head.repo.default_branch}` +
'/.buildkite/pipeline/description' +
`/${orgSlug}?filename=${pipeline.slug}.md` +
`&value=%23%20${pipeline.slug}%0A%0A%5B` +
`Document%20${pipeline.slug}%27s%20RocketBot%20options%20here%5D`
const url = new URL(
`/new/${prData.head.repo.default_branch}`,
`https://github.com/${prData.head.repo.full_name}`,
);
url.searchParams.append(
'filename',
`.buildkite/pipeline/description/${orgSlug}/${pipeline.slug}.md`,
);
url.searchParams.append(
'value',
`# ${pipeline.slug}
[Document ${pipeline.slug}'s RocketBot options here]`,
);
return url.toString();
}

0 comments on commit 7548ed2

Please sign in to comment.