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
26 changes: 26 additions & 0 deletions config-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,32 @@ runs:
echo "DEVELOCITY_ACCESS_KEY=${{ steps.develocity-hostname.outputs.hostname }}=$DEVELOCITY_TOKEN" >> "$GITHUB_ENV"
fi

- name: Configure Gradle wrapper download resilience
if: steps.config-gradle-completed.outputs.skip != 'true'
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
WRAPPER_PROPS="gradle/wrapper/gradle-wrapper.properties"
if [[ ! -f "$WRAPPER_PROPS" ]]; then
echo "No ${WRAPPER_PROPS} found, skipping wrapper resilience config"
exit 0
fi

update_prop() {
local key="$1" value="$2"
if grep -q "^${key}=" "$WRAPPER_PROPS"; then
sed -i.bak "s/^${key}=.*/${key}=${value}/" "$WRAPPER_PROPS"
Comment thread
gitar-bot[bot] marked this conversation as resolved.
else
[[ -s "$WRAPPER_PROPS" && -n "$(tail -c1 "$WRAPPER_PROPS")" ]] && echo >> "$WRAPPER_PROPS"
echo "${key}=${value}" >> "$WRAPPER_PROPS"
fi
}
Comment thread
gitar-bot[bot] marked this conversation as resolved.

update_prop networkTimeout 60000
update_prop retries 3
update_prop retryBackOffMs 1000
Comment thread
gitar-bot[bot] marked this conversation as resolved.
rm -f "${WRAPPER_PROPS}.bak"

- name: Configure Gradle
if: steps.config-gradle-completed.outputs.skip != 'true'
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
Expand Down
Loading