Skip to content

Commit ca0918a

Browse files
committed
Check daily for Gradle wrapper updates
1 parent 1cd05d6 commit ca0918a

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env kotlin
2+
@file:DependsOn("it.krzeminski:github-actions-kotlin-dsl:0.19.0")
3+
4+
import it.krzeminski.githubactions.actions.actions.CheckoutV3
5+
import it.krzeminski.githubactions.actions.gradleupdate.UpdateGradleWrapperActionV1
6+
import it.krzeminski.githubactions.domain.RunnerType.UbuntuLatest
7+
import it.krzeminski.githubactions.domain.triggers.Cron
8+
import it.krzeminski.githubactions.domain.triggers.Schedule
9+
import it.krzeminski.githubactions.domain.triggers.WorkflowDispatch
10+
import it.krzeminski.githubactions.dsl.workflow
11+
import it.krzeminski.githubactions.yaml.writeToFile
12+
13+
workflow(
14+
name = "Update Gradle Wrapper",
15+
on = listOf(
16+
Schedule(listOf(Cron("0 0 * * *"))), // Daily, at midnight.
17+
WorkflowDispatch(),
18+
),
19+
sourceFile = __FILE__.toPath(),
20+
) {
21+
job(
22+
id = "update-gradle-wrapper",
23+
runsOn = UbuntuLatest,
24+
) {
25+
uses(CheckoutV3())
26+
uses(UpdateGradleWrapperActionV1())
27+
}
28+
}.writeToFile()
29+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was generated using Kotlin DSL (.github/workflows/update-gradle-wrapper.main.kts).
2+
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
3+
# Generated with https://github.com/krzema12/github-actions-kotlin-dsl
4+
5+
name: Update Gradle Wrapper
6+
7+
on:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
"check_yaml_consistency":
14+
runs-on: "ubuntu-latest"
15+
steps:
16+
- id: step-0
17+
name: Check out
18+
uses: actions/checkout@v3
19+
- id: step-1
20+
name: Execute script
21+
run: rm '.github/workflows/update-gradle-wrapper.yaml' && '.github/workflows/update-gradle-wrapper.main.kts'
22+
- id: step-2
23+
name: Consistency check
24+
run: git diff --exit-code '.github/workflows/update-gradle-wrapper.yaml'
25+
"update-gradle-wrapper":
26+
runs-on: "ubuntu-latest"
27+
needs:
28+
- "check_yaml_consistency"
29+
steps:
30+
- id: step-0
31+
uses: actions/checkout@v3
32+
- id: step-1
33+
uses: gradle-update/update-gradle-wrapper-action@v1

0 commit comments

Comments
 (0)