Skip to content

Commit a122cf5

Browse files
authored
Document develocity-token-expiry parameter
Fixes #367
1 parent 5baa1de commit a122cf5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/setup-gradle.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,8 @@ To publish to https://scans.gradle.com, you must specify in your workflow that y
753753
## Managing Develocity access keys
754754

755755
Develocity access keys are long-lived, creating risks if they are leaked. To mitigate this risk this,
756-
the `setup-gradle` action can automatically attempt to obtain a short-lived access token to authenticate with Develocity.
756+
the `setup-gradle` action can automatically attempt to obtain a [short-lived access token](https://docs.gradle.com/develocity/gradle-plugin/current/#short_lived_access_tokens)
757+
to use when authenticating with Develocity.
757758
The short-lived access token will then be used wherever a Develocity access key is required.
758759

759760
```yaml
@@ -767,6 +768,21 @@ The short-lived access token will then be used wherever a Develocity access key
767768
run: ./gradlew build
768769
```
769770

771+
### Increasing the expiry time for Develocity access tokens
772+
773+
By default, a short-lived Develocity access token will be valid for 2 hours from the time it is generated. If your workflows take longer than
774+
2 hours to complete, you may see failure to publish Build Scans due to access token expiry.
775+
776+
To avoid this, use the `develocity-token-expiry` parameter to specify a different token expiry in hours.
777+
778+
```yaml
779+
- name: Setup Gradle
780+
uses: gradle/actions/setup-gradle@v4
781+
with:
782+
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
783+
develocity-token-expiry: 8 # The number of hours that the access token should remain valid (max 24).
784+
```
785+
770786
### Develocity access key supplied as environment variable
771787

772788
The preferred mechanism is to supply the long-lived Develocity access key directly to `setup-gradle` via

0 commit comments

Comments
 (0)