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 68c4f1e6bc
commit e13b204f4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 }}

View file

@ -48,6 +48,9 @@ do
esac
done
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo Branch used: $BRANCH
if [[ -z ${TOKEN} ]]; then
echo "No token specified, either set the env var GITHUB_TOKEN or use the --token option"
exit 1
@ -70,8 +73,6 @@ git config user.email "benoitm+elementbot@element.io"
git add -A
git commit -m "Update screenshots"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Pushing changes"
git push "https://$TOKEN@github.com/$REPO.git" $BRANCH:refs/heads/$BRANCH
git push "https://$TOKEN@github.com/$REPO.git" $BRANCH
echo "Done!"

View file

@ -109,7 +109,7 @@ private fun IconsPreview(
textAlign = TextAlign.Center,
)
iconsList.chunked(6).forEach { iconsRow ->
Row(horizontalArrangement = Arrangement.spacedBy(1.dp)) {
Row(horizontalArrangement = Arrangement.spacedBy(2.dp)) {
iconsRow.forEach { icon ->
Column(
modifier = Modifier.width(48.dp),

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c10bbc922df738a2b45424142dd476c71c336ac398fa93be98a1c1a421d566a
size 71443
oid sha256:ef08fe950fc60d65de83ca9cccd1173c8e2ce2e0f3b107328b8e512607cf6210
size 71483

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69b356a9027e5a09df13a824e061ca2cb0b079b8f73513cf3d4bac4fc1644364
size 83226
oid sha256:d9f006852d8bb4c2a29558c1f9300ff8f30ac8170c888ab1847f484e16232fbc
size 83286

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:adabc468933e39fb1dc898cb9cf72c8e62f59d50aa4dec3bbb7d3aa89e385a3a
size 21158
oid sha256:1c29d7b48466b4679d21f71b5d50e4614708fd3bd010b0b0d0cc10d665b3f88a
size 21297

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a479cf4d877676d41df4e618571d8d51e44fe42dbb3e49d3db0f31cf0500928a
size 68262
oid sha256:bf8196164c67faa7ccd86d5f3e83ad1f42b62e0c4592a9ef4b2b6a8eac177dfc
size 68602

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa602e8416b8c609b5c2ee7331a7e1bb17b4a8c4bf25f9d402a2723d88f2e0a7
size 80152
oid sha256:d751451fd53f6948280bf9f22fe7511b39febf71e81abc576a55593906287043
size 80464

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a51e0cd2d7c1dfdaa2fecb381b13183526f89ef886df573b2b4932281653e147
size 19876
oid sha256:0bd0b3f434d124b73332f395016ea605b5cdf06eee0e6f6a86a2c80f86081b02
size 20005

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d22ae52d7d0e222743fa7b8cf0d767a5af8c103fce339640f1b430560f6b7893
size 76682
oid sha256:33e9797ee581935791609a03b4202154a9c71f5e85f0412b5b71ae92346c393c
size 76998

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:312cfaf08c6a850e2ca167a2b53420e1c6bc8e375ab565bd41c2d643d66a7c58
size 73923
oid sha256:0847d8d596d01616d23d7709a888bc0702075d68e734e57d4c95f421aef34153
size 73886