Skip to content

Commit c7717a6

Browse files
authored
* CCM-5197 added script * CCM-5197 create autolink script * CCM-5197 fixed README
1 parent ca43476 commit c7717a6

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

scripts/config/vale/styles/Vocab/words/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ drawio
2424
rawContent
2525
endcapture
2626
Cognito
27+
Jira

scripts/git-repo/auto-link.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GitHub
2+
3+
## Auto link Protection Rules
4+
5+
This will create the auto link to Jira.
6+
7+
```sh
8+
./auto-link.sh $reponame $PAT
9+
```
10+
11+
PAT must have `administration:write`. [Create an auto link](https://docs.github.com/en/rest/repos/autolinks?apiVersion=2022-11-28#create-an-autolink-for-a-repository)

scripts/git-repo/auto-link.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
curl -L \
4+
-X POST \
5+
-H "Accept: application/vnd.github+json" \
6+
-H "Authorization: Bearer $2" \
7+
-H "X-GitHub-Api-Version: 2022-11-28" \
8+
https://api.github.com/repos/NHSDigital/$1/autolinks \
9+
-d '{"key_prefix":"CCM-","url_template":" https://nhsd-jira.digital.nhs.uk/browse/CCM-<num>","is_alphanumeric":true}'

0 commit comments

Comments
 (0)