-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run 'record screenshots' flow if label is present (#1860)
* Run 'record screenshots' flow if label is present --------- Co-authored-by: ElementBot <[email protected]>
- Loading branch information
1 parent
68c4f1e
commit e13b204
Showing
11 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,33 @@ name: Record screenshots | |
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [ labeled ] | ||
|
||
# Enrich gradle.properties for CI/CD | ||
env: | ||
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3584m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.incremental=false -XX:+UseParallelGC | ||
|
||
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/[email protected] | ||
with: | ||
persist-credentials: false | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: ⏬ Checkout with LFS (Branch) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: nschloe/[email protected] | ||
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 "[email protected]" | |
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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...nsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_0,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...nsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...nsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_2,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ystem.icons_IconsCompound_null_IconsCompound-Night_1_null_0,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ystem.icons_IconsCompound_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ystem.icons_IconsCompound_null_IconsCompound-Night_1_null_2,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
....designsystem.icons_IconsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...esignsystem.icons_IconsOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.