Skip to content

Commit 8ae9278

Browse files
committed
feat: de-configure Gradle action
1 parent 76b6034 commit 8ae9278

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/actions/configure-gradle/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ runs:
1313
run: |
1414
cd ${{ inputs.working-directory }}
1515
16-
GRADLE_VERSION=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p')
16+
ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties)
17+
echo "ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties)" >> $GITHUB_ENV
18+
19+
GRADLE_VERSION=$(echo $ORIGINAL_URL | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p')
1720
CUSTOM_URL="https://d2pjps8lqszrgq.cloudfront.net/gradle-$GRADLE_VERSION-bin.zip"
1821
1922
echo Configuring custom Gradle distribution URL with version: $GRADLE_VERSION
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: De-configure Gradle
2+
description: De-configures Gradle for use in CI
3+
inputs:
4+
working-directory:
5+
description: The directory in which to run the action
6+
default: .
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: De-configure custom Gradle distribution URL
12+
shell: bash
13+
run: |
14+
cd ${{ inputs.working-directory }}
15+
16+
echo Setting distribution URL to: $ORIGINAL_URL
17+
18+
# Replace the line containing "distributionUrl" with the original distributionUrl
19+
$SED_CMD "/distributionUrl/c\\
20+
$ORIGINAL_URL\\
21+
" ./gradle/wrapper/gradle-wrapper.properties

0 commit comments

Comments
 (0)