Change build ref of recurring build if PR (#4490)

* Change build ref of recurring build if PR

* Add PR_NUMBER env var

* Edit the BUILD_REF to <commit>.pr-<number>
This commit is contained in:
Filipe Freire 2022-02-14 17:21:45 +00:00 committed by David Marby
parent d985f5f3be
commit 8d1b15355d

View File

@ -12,7 +12,8 @@ on:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
env:
PR_NUMBER: ${{ github.event.number }}
jobs: jobs:
build-and-upload-artifacts: build-and-upload-artifacts:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -40,7 +41,7 @@ jobs:
- name: Package - name: Package
shell: bash shell: bash
run: BUILD_REF="$(git rev-parse --short HEAD)" BUILD_TARGETS='${{ matrix.build-targets }}' npm run app-package run: BUILD_REF="$(git rev-parse --short HEAD)${{ github.event_name == 'pull_request' && '.pr-$PR_NUMBER' }}" BUILD_TARGETS='${{ matrix.build-targets }}' npm run app-package
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2