File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 26
26
set -x
27
27
echo "org=${TARGET_GITHUB_REPOSITORY%%/*}" >>$GITHUB_OUTPUT &&
28
28
echo "repo=${TARGET_GITHUB_REPOSITORY#*/}" >>$GITHUB_OUTPUT &&
29
+ test workflow_dispatch != '${{ github.event_name }}' || {
30
+ echo "result=true" >>$GITHUB_OUTPUT
31
+ exit 0
32
+ }
29
33
source="$(git ls-remote "$SOURCE_REPOSITORY" master)" &&
30
34
target="$(git ls-remote https://github.com/"$TARGET_GITHUB_REPOSITORY" lore-$LORE_EPOCH)" &&
31
35
echo "result=$(test "${source%% *}" = "${target%% *}" && echo false || echo true)" >>$GITHUB_OUTPUT
51
55
env :
52
56
GITHUB_TOKEN : ${{ steps.token.outputs.token }}
53
57
run : |
54
- git push https://$GITHUB_ACTOR:[email protected] /$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH
58
+ backoff=0
59
+ while (
60
+ git push https://$GITHUB_ACTOR:[email protected] /$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH;
61
+ echo $? >exit.code
62
+ ) 2>&1 | tee output.log; exit_code="$(cat exit.code)"; test 0 != "$exit_code" && grep 403 output.log
63
+ do
64
+ backoff=$(($backoff+1))
65
+ test 10 -gt $backoff || {
66
+ echo '::error::Failed too many times' >&2
67
+ exit $exit_code
68
+ }
69
+ printf '::warning::access token somehow not yet active; sleeping for %d seconds\nexit code: %s\n' \
70
+ $backoff $(cat exit.code)
71
+ sleep $backoff
72
+ done
73
+ exit $exit_code
You can’t perform that action at this time.
0 commit comments