Skip to content

Check Dependency Updates #220

Check Dependency Updates

Check Dependency Updates #220

name: Check Dependency Updates
on:
schedule:
- cron: "37 13 * * SAT"
workflow_dispatch:
jobs:
dependency-updates:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Detect gradle version
uses: actions/github-script@v6
id: gradle-version-detector
with:
result-encoding: string
script: |
const scriptPath = '/./.github/scripts/gradle-version-detector.js'
const script = require(`${process.env.GITHUB_WORKSPACE}${scriptPath}`)
return script()
- name: Fetch gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ steps.gradle-version-detector.outputs.result }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Check Dependency Updates
run: ./gradlew dependencyUpdates
- name: Log dependency update report
run: cat build/dependencyUpdates/dependency_update_report.txt
- name: 💌 Send email report
uses: actions/github-script@v6
env:
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }}
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }}
with:
script: |
const subject = `Dependency update report of Jetflix ¯\\_(ツ)_/¯`
const report = require('fs').readFileSync('build/dependencyUpdates/dependency_update_report.txt', 'utf8')
const mailSenderScriptPath = '/./.github/scripts/report-mail-sender.js'
const mailSenderScript = require(`${process.env.GITHUB_WORKSPACE}${mailSenderScriptPath}`)
mailSenderScript(subject, report)
- name: Share dependency update reports
uses: actions/upload-artifact@v3
with:
name: dependency-update-reports
path: build/dependencyUpdates