Skip to content

Commit

Permalink
ci(theme-builder): handle external pull request [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakutoc committed Nov 20, 2023
1 parent 893a1be commit dad1b0b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/theme-builder-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,43 @@ name: PR theme-builder
on:
pull_request:
branches:
- dev
- master
pull_request_target:
branches:
- dev

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
authorize:
name: Authorize external pull request
uses: ./.github/workflows/authorize-external-pr.yml

build:
name: Build
runs-on: ubuntu-latest
needs: authorize
env:
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
PR_NAME: pr-${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
show-progress: false
ref: refs/pull/${{github.event.pull_request.number}}/merge

- uses: ./.github/actions/prepare-environment
- name: Prepare environment
uses: ./.github/actions/prepare-environment

- name: Prepare directory for build
run: mkdir s3_build

# TODO: https://github.com/salute-developers/plasma/issues/255
- name: Lerna bootstrap with scope
run: |
run: |
npx lerna bootstrap --scope @salutejs/plasma-theme-builder --scope=@salutejs/plasma-{tokens,tokens-utils}
# TODO: https://github.com/salute-developers/plasma/issues/603
Expand Down Expand Up @@ -67,14 +78,14 @@ jobs:
script: |
const branchName = context.payload.pull_request.head.ref;
const themeName = branchName.split('theme-builder-')[1];
const params = themeName ? `?theme=${themeName}&branch=${branchName}` : '';
const params = themeName ? `?theme=${themeName}&branch=${branchName}` : '';
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Theme Builder app deployed!
http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-${context.issue.number}/${params}
`
})

0 comments on commit dad1b0b

Please sign in to comment.