diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index b60a8e6..fd56284 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -8,9 +8,19 @@ jobs: check-title: runs-on: ubuntu-latest steps: + - name: Generate GitHub App token + id: generate-deployment-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.DEPLOY_APP_ID }} + private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} + owner: HDRUK + repositories: | + ${{ github.event.repository.name }} + - name: Check PR Title Format env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }} PR_TITLE: ${{ github.event.pull_request.title }} PR_NUMBER: ${{ github.event.pull_request.number }} PR_REPO: ${{ github.repository }} diff --git a/.github/workflows/semantic-release-workflow.yml b/.github/workflows/semantic-release-workflow.yml index db44829..c03062e 100644 --- a/.github/workflows/semantic-release-workflow.yml +++ b/.github/workflows/semantic-release-workflow.yml @@ -17,11 +17,21 @@ jobs: permissions: write-all runs-on: ubuntu-latest steps: + - name: Generate GitHub App token + id: generate-deployment-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.DEPLOY_APP_ID }} + private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} + owner: HDRUK + repositories: | + ${{ github.event.repository.name }} + - name: Checkout id: checkout uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ steps.generate-deployment-token.outputs.token }} ref: main fetch-depth: 0 @@ -37,7 +47,7 @@ jobs: run: npx semantic-release env: JIRA_URL: ${{ vars.JIRA_URL }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }} - name: Set Git config run: | @@ -51,7 +61,7 @@ jobs: - name: Merge changes from main to dev env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-deployment-token.outputs.token }} run: | git fetch origin dev git checkout dev