Skip to content

Commit

Permalink
parallel computing bug fixed & default values added
Browse files Browse the repository at this point in the history
  • Loading branch information
sitdisch committed May 17, 2021
1 parent 1516104 commit 2e658ec
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL-group(s) to one/multiple target repo(s)/branch(es) in parallel
# Author: Sitdisch
# Version: v2.0
# Version: v2.1
# Source: https://github.com/myactionway/lighthouse-badger-action
# License: MIT
# Copyright (c) 2021 Sitdisch
Expand All @@ -20,25 +20,28 @@ inputs:
required: true
badges_args:
description: 'Badges arguments: -b, -l, -o, -r, -s'
required: true
default: '-b pagespeed -o lighthouse_results -r'
audit_type:
description: 'Audit type: mobile, desktop, both or both_p'
required: true
default: 'both'
mobile_lighthouse_params:
description: 'Lighthouse parameters mobile audit'
required: true
default: '--throttling.cpuSlowdownMultiplier=2'
desktop_lighthouse_params:
description: 'Lighthouse parameters desktop audit'
required: true
default: '--preset=desktop --throttling.cpuSlowdownMultiplier=1'
user_name:
description: 'User who should commit'
required: true
default: 'github-actions[bot]'
user_email:
description: 'User e-mail address'
required: true
default: '41898282+github-actions[bot]@users.noreply.github.com'
commit_message:
description: 'Commit message'
required: true
default: 'Lighthouse-Badger[bot]: Results Added'
max_push_attempts:
description: 'Maximum number of push attempts'
default: 5

runs:
using: "composite"
Expand Down Expand Up @@ -76,5 +79,18 @@ runs:
git fetch
git add $RESULTS_PATH
git commit -am "${{ inputs.commit_message }}"
git push
i=0
while true; do
{
git push && break
} || {
i=$(( $i + 1 ))
echo $i"th push attempt failed"
if [ $i = ${{ inputs.max_push_attempts }} ]; then
break
fi
git pull
git fetch
}
done
shell: bash

0 comments on commit 2e658ec

Please sign in to comment.