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:
committed by
GitHub
parent
ec2fa8b5a2
commit
b1f2370e72
21
.github/workflows/recordScreenshots.yml
vendored
21
.github/workflows/recordScreenshots.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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),
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user