From 13e9e26034125d84aa979ef41a5666471079ed28 Mon Sep 17 00:00:00 2001 From: DatLag Date: Thu, 18 Jul 2024 22:05:58 +0200 Subject: [PATCH] added github workflow --- .github/CODEOWNERS | 1 + .github/workflows/dependency-versions.yml | 53 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/dependency-versions.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..db8f93c --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @datl4g \ No newline at end of file diff --git a/.github/workflows/dependency-versions.yml b/.github/workflows/dependency-versions.yml new file mode 100644 index 0000000..147e4b4 --- /dev/null +++ b/.github/workflows/dependency-versions.yml @@ -0,0 +1,53 @@ +name: Check Dependency Versions +on: + push: + workflow_dispatch: + +jobs: + dependency-versions: + runs-on: ubuntu-latest + + permissions: + checks: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Check Dependency Versions + run: ./gradlew dependencyUpdates + + - name: Publish version results + run: | + ruby << 'EOF' | gh api -X POST '/repos/${{ github.repository }}/check-runs' --input - + require 'json' + report = { + name: ENV.fetch('REPORT_CHECK_NAME'), + head_sha: ENV.fetch('REPORT_SHA'), + status: 'completed', + conclusion: ENV.fetch('REPORT_CONCLUSION'), + output: { + title: ENV.fetch('REPORT_CHECK_OUTPUT_TITLE'), + summary: File.read(ENV.fetch('REPORT_CHECK_OUTPUT_SUMMARY_FILE')), + }, + } + puts report.to_json + EOF + env: + REPORT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + GITHUB_TOKEN: ${{ github.token }} + REPORT_CHECK_NAME: Version Results + REPORT_CHECK_OUTPUT_TITLE: ${{ github.event.repository.updated_at }} + REPORT_CHECK_OUTPUT_SUMMARY_FILE: build/dependencyUpdates/report.md + REPORT_CONCLUSION: ${{ job.status }} + shell: bash \ No newline at end of file