Dependency Updates #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dependency Updates | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * SUN" | |
jobs: | |
updates: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-gradle | |
with: | |
os: ubuntu-latest | |
cache-disabled: true | |
- name: Run dependency updates | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: :dependencyUpdates --init-script gradle/libs.updates.gradle.kts --no-configure-on-demand | |
- name: Write Job Summary | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { GITHUB_WORKSPACE } = process.env | |
const { promises: fs } = require('fs') | |
const summary = core.summary.addHeading('Dependency Updates Report') | |
const globber = await glob.create('**/build/dependencyUpdates/report.txt') | |
for await (const file of globber.globGenerator()) { | |
const content = await fs.readFile(file, 'utf8') | |
const f1 = file.slice(file.indexOf(GITHUB_WORKSPACE) + GITHUB_WORKSPACE.length + 1) | |
const f2 = f1.slice(0, f1.indexOf('build/')) | |
const name = f2.length ? f2 : 'root' | |
summary.addDetails(name, content) | |
} | |
await summary.write() |