diff --git a/.github/actions/configure-gradle/action.yml b/.github/actions/configure-gradle/action.yml index cac7f4a..06ab655 100644 --- a/.github/actions/configure-gradle/action.yml +++ b/.github/actions/configure-gradle/action.yml @@ -13,7 +13,10 @@ runs: run: | cd ${{ inputs.working-directory }} - GRADLE_VERSION=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p') + ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties) + echo "ORIGINAL_URL=$ORIGINAL_URL" >> $GITHUB_ENV + + GRADLE_VERSION=$(echo $ORIGINAL_URL | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p') CUSTOM_URL="https://d2pjps8lqszrgq.cloudfront.net/gradle-$GRADLE_VERSION-bin.zip" echo Configuring custom Gradle distribution URL with version: $GRADLE_VERSION diff --git a/.github/actions/restore-gradle/action.yml b/.github/actions/restore-gradle/action.yml new file mode 100644 index 0000000..c38f8ea --- /dev/null +++ b/.github/actions/restore-gradle/action.yml @@ -0,0 +1,21 @@ +name: Restore Gradle +description: Restores Gradle configuration to its original state +inputs: + working-directory: + description: The directory in which to run the action + default: . + +runs: + using: composite + steps: + - name: Restore Gradle distribution URL + shell: bash + run: | + cd ${{ inputs.working-directory }} + + echo Setting distribution URL to: $ORIGINAL_URL + + # Replace the line containing "distributionUrl" with the original distributionUrl + $SED_CMD "/distributionUrl/c\\ + $ORIGINAL_URL\\ + " ./gradle/wrapper/gradle-wrapper.properties \ No newline at end of file