Skip to content

Commit 28e0131

Browse files
authored
feat(GAT-7957): added github authentication for the pipeline (#36)
2 parents 7c4bf8f + af54da5 commit 28e0131

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/pr-title-check.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ jobs:
88
check-title:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Generate GitHub App token
12+
id: generate-deployment-token
13+
uses: actions/create-github-app-token@v2
14+
with:
15+
app-id: ${{ secrets.DEPLOY_APP_ID }}
16+
private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }}
17+
owner: HDRUK
18+
repositories: |
19+
${{ github.event.repository.name }}
20+
1121
- name: Check PR Title Format
1222
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }}
1424
PR_TITLE: ${{ github.event.pull_request.title }}
1525
PR_NUMBER: ${{ github.event.pull_request.number }}
1626
PR_REPO: ${{ github.repository }}

.github/workflows/semantic-release-workflow.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,21 @@ jobs:
1717
permissions: write-all
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Generate GitHub App token
21+
id: generate-deployment-token
22+
uses: actions/create-github-app-token@v2
23+
with:
24+
app-id: ${{ secrets.DEPLOY_APP_ID }}
25+
private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }}
26+
owner: HDRUK
27+
repositories: |
28+
${{ github.event.repository.name }}
29+
2030
- name: Checkout
2131
id: checkout
2232
uses: actions/checkout@v6
2333
with:
24-
token: ${{ secrets.GH_TOKEN }}
34+
token: ${{ steps.generate-deployment-token.outputs.token }}
2535
ref: main
2636
fetch-depth: 0
2737

@@ -37,7 +47,7 @@ jobs:
3747
run: npx semantic-release
3848
env:
3949
JIRA_URL: ${{ vars.JIRA_URL }}
40-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
50+
GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }}
4151

4252
- name: Set Git config
4353
run: |
@@ -51,7 +61,7 @@ jobs:
5161
5262
- name: Merge changes from main to dev
5363
env:
54-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
64+
GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }}
5565
run: |
5666
git fetch origin dev
5767
git checkout dev

0 commit comments

Comments
 (0)