Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/sync-mailing-list-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
set -x
echo "org=${TARGET_GITHUB_REPOSITORY%%/*}" >>$GITHUB_OUTPUT &&
echo "repo=${TARGET_GITHUB_REPOSITORY#*/}" >>$GITHUB_OUTPUT &&
test workflow_dispatch != '${{ github.event_name }}' || {
echo "result=true" >>$GITHUB_OUTPUT
exit 0
}
source="$(git ls-remote "$SOURCE_REPOSITORY" master)" &&
target="$(git ls-remote https://github.com/"$TARGET_GITHUB_REPOSITORY" lore-$LORE_EPOCH)" &&
echo "result=$(test "${source%% *}" = "${target%% *}" && echo false || echo true)" >>$GITHUB_OUTPUT
Expand All @@ -51,4 +55,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
run: |
git push https://$GITHUB_ACTOR:[email protected]/$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH
backoff=0
while (
git push https://$GITHUB_ACTOR:[email protected]/$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH;
echo $? >exit.code
) 2>&1 | tee output.log; exit_code="$(cat exit.code)"; test 0 != "$exit_code" && grep 403 output.log
do
backoff=$(($backoff+1))
test 10 -gt $backoff || {
echo '::error::Failed too many times' >&2
exit $exit_code
}
printf '::warning::access token somehow not yet active; sleeping for %d seconds\nexit code: %s\n' \
$backoff $(cat exit.code)
sleep $backoff
done
exit $exit_code