Skip to content

Commit

Permalink
Document develocity-token-expiry parameter
Browse files Browse the repository at this point in the history
Fixes #367
  • Loading branch information
bigdaz authored Sep 13, 2024
1 parent 5baa1de commit a122cf5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/setup-gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ To publish to https://scans.gradle.com, you must specify in your workflow that y
## Managing Develocity access keys

Develocity access keys are long-lived, creating risks if they are leaked. To mitigate this risk this,
the `setup-gradle` action can automatically attempt to obtain a short-lived access token to authenticate with Develocity.
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)
to use when authenticating with Develocity.
The short-lived access token will then be used wherever a Develocity access key is required.

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

### Increasing the expiry time for Develocity access tokens

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
2 hours to complete, you may see failure to publish Build Scans due to access token expiry.

To avoid this, use the `develocity-token-expiry` parameter to specify a different token expiry in hours.

```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
develocity-token-expiry: 8 # The number of hours that the access token should remain valid (max 24).
```

### Develocity access key supplied as environment variable

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

0 comments on commit a122cf5

Please sign in to comment.