Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* CCM-5197 added script

* CCM-5197 create autolink script

* CCM-5197 fixed README
  • Loading branch information
timireland authored Jul 17, 2024
1 parent ca43476 commit c7717a6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/config/vale/styles/Vocab/words/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ drawio
rawContent
endcapture
Cognito
Jira
11 changes: 11 additions & 0 deletions scripts/git-repo/auto-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GitHub

## Auto link Protection Rules

This will create the auto link to Jira.

```sh
./auto-link.sh $reponame $PAT
```

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)
9 changes: 9 additions & 0 deletions scripts/git-repo/auto-link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $2" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NHSDigital/$1/autolinks \
-d '{"key_prefix":"CCM-","url_template":" https://nhsd-jira.digital.nhs.uk/browse/CCM-<num>","is_alphanumeric":true}'

0 comments on commit c7717a6

Please sign in to comment.