Run 'record screenshots' flow if label is present (#1860)

* Run 'record screenshots' flow if label is present

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa
2023-11-23 08:25:33 +01:00
committed by GitHub
parent ec2fa8b5a2
commit b1f2370e72
11 changed files with 39 additions and 23 deletions

View File

@@ -2,6 +2,8 @@ name: Record screenshots
on:
workflow_dispatch:
pull_request:
types: [ labeled ]
# Enrich gradle.properties for CI/CD
env:
@@ -9,11 +11,24 @@ env:
jobs:
record:
name: Record screenshots on branch ${{ github.ref_name }}
name: Record screenshots on branch ${{ github.event.pull_request.head.ref || github.ref_name }}
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Record-Screenshots'
steps:
- name: ⏬ Checkout with LFS
- name: Remove Record-Screenshots label
if: github.event.label.name == 'Record-Screenshots'
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: Record-Screenshots
- name: ⏬ Checkout with LFS (PR)
if: github.event.label.name == 'Record-Screenshots'
uses: nschloe/action-cached-lfs-checkout@v1.2.2
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.ref }}
- name: ⏬ Checkout with LFS (Branch)
if: github.event_name == 'workflow_dispatch'
uses: nschloe/action-cached-lfs-checkout@v1.2.2
with:
persist-credentials: false
@@ -28,7 +43,7 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Record screenshots
run: "./.github/workflows/scripts/recordScreenshots.sh"
run: ./.github/workflows/scripts/recordScreenshots.sh
env:
GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}