mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Try using ElementBot for recording screenshots too (#641)
This commit is contained in:
committed by
GitHub
parent
c18ee4093c
commit
97fbe4f4b5
@@ -16,6 +16,7 @@ jobs:
|
|||||||
- name: ⏬ Checkout with LFS
|
- name: ⏬ Checkout with LFS
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
persist-credentials: false
|
||||||
lfs: 'true'
|
lfs: 'true'
|
||||||
- name: ☕️ Use JDK 17
|
- name: ☕️ Use JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
@@ -30,5 +31,6 @@ jobs:
|
|||||||
- name: Record screenshots
|
- name: Record screenshots
|
||||||
run: "./.github/workflows/scripts/recordScreenshots.sh"
|
run: "./.github/workflows/scripts/recordScreenshots.sh"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
|
||||||
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
|
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,43 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [[ -z ${GITHUB_TOKEN} ]]; then
|
TOKEN=$GITHUB_TOKEN
|
||||||
echo "Missing GITHUB_TOKEN variable"
|
REPO=$GITHUB_REPOSITORY
|
||||||
|
|
||||||
|
SHORT=t:,r:
|
||||||
|
LONG=token:,repo:
|
||||||
|
OPTS=$(getopt -a -n recordScreenshots --options $SHORT --longoptions $LONG -- "$@")
|
||||||
|
|
||||||
|
eval set -- "$OPTS"
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-t | --token )
|
||||||
|
TOKEN="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-r | --repo )
|
||||||
|
REPO="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift;
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unexpected option: $1"
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z ${TOKEN} ]]; then
|
||||||
|
echo "No token specified, either set the env var GITHUB_TOKEN or use the --token option"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z ${GITHUB_REPOSITORY} ]]; then
|
if [[ -z ${REPO} ]]; then
|
||||||
echo "Missing GITHUB_REPOSITORY variable"
|
echo "No repo specified, either set the env var GITHUB_REPOSITORY or use the --repo option"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -35,6 +65,8 @@ git config user.email "benoitm+elementbot@element.io"
|
|||||||
git add -A
|
git add -A
|
||||||
git commit -m "Update screenshots"
|
git commit -m "Update screenshots"
|
||||||
|
|
||||||
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
echo "Pushing changes"
|
echo "Pushing changes"
|
||||||
git push "https://$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
|
git push "https://$TOKEN@github.com/$REPO.git" $BRANCH:refs/heads/$BRANCH
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|||||||
Reference in New Issue
Block a user