Skip to content

Commit

Permalink
SDPLAT-26630: use GH_APP in main.yml (#3731)
Browse files Browse the repository at this point in the history
  • Loading branch information
olliecurtis authored Jan 31, 2025
1 parent f0802a7 commit 2fdf327
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Build

on:
workflow_call:
secrets:
GH_APP_PRIVATE_KEY:
required: true

defaults:
run:
Expand Down Expand Up @@ -96,11 +99,17 @@ jobs:
brotli -d ${{env.BUILD_LOGS}}.tar.br
tar -xf ${{env.BUILD_LOGS}}.tar
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Danger
run: npm run danger
if: github.ref != 'refs/heads/main' && github.repository == github.event.pull_request.head.repo.full_name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

PercyTests:
runs-on: ubuntu-latest
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/label-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- uses: docker://agilepathway/pull-request-label-checker:latest
with:
one_of: major,minor,patch,skip-changelog
repo_token: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ steps.app-token.outputs.token }}
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ jobs:
contents: write
pull-requests: read
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Draft release notes
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,17 @@ jobs:
external_repository: backpack/storybook-prs
publish_branch: main

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Link to the pull request build
uses: actions/github-script@v7
if: github.ref != 'refs/heads/main' && github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]'
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
pull-requests: write
needs: [Create-NPM-Cache, Create-Build-Cache]
uses: ./.github/workflows/_build.yml
secrets: inherit

ReleaseWeb:
name: Release @skyscanner/backpack-web to NPM
Expand Down

0 comments on commit 2fdf327

Please sign in to comment.