From e49c71afe96ebeaf341eaf3af382cc3b2d4824e2 Mon Sep 17 00:00:00 2001 From: Jakob Frank Date: Wed, 24 Apr 2024 15:41:52 +0200 Subject: [PATCH 1/2] #113 Update Dependabot Configuration --- .github/dependabot.yaml | 14 ++++++++++++ .github/workflows/dependabot.yaml | 34 +++++++++++++++++++++++++++++ .github/workflows/test-results.yaml | 19 +++++----------- 3 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 1f51bd1..4999fb3 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -2,15 +2,29 @@ version: 2 updates: - package-ecosystem: github-actions directory: / + target-branch: 'develop' assignees: - ja-fra schedule: interval: weekly + groups: + github-action: + patterns: + - "actions/*" + docker: + patterns: + - "docker/*" - package-ecosystem: maven directory: / + target-branch: 'develop' schedule: interval: daily ignore: - # We want to stay on the v5 of the openapi-generator dependency-name: "org.openapitools:openapi-generator-maven-plugin" update-types: ["version-update:semver-major"] + groups: + maven-plugin: + patterns: + - "org.apache.maven.plugins:*" + - "org.codehaus.mojo:*" diff --git a/.github/workflows/dependabot.yaml b/.github/workflows/dependabot.yaml new file mode 100644 index 0000000..eee60d0 --- /dev/null +++ b/.github/workflows/dependabot.yaml @@ -0,0 +1,34 @@ +name: Dependabot Automation +on: pull_request + +permissions: + contents: write + pull-requests: write + issues: write + repository-projects: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot Metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Label Major Updates + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-major'}} + run: | + gh label create "major-update" --color "B60205" --description "Major Dependency Update" --repo "$REPO" || true + gh pr edit "$PR_URL" --add-label "major-update" + env: + REPO: ${{github.repository}} + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable Auto-Merge for Patch Updates + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test-results.yaml b/.github/workflows/test-results.yaml index e2a2062..09cd284 100644 --- a/.github/workflows/test-results.yaml +++ b/.github/workflows/test-results.yaml @@ -30,20 +30,11 @@ jobs: steps: - name: Download and Extract Artifacts - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: | - mkdir -p artifacts && cd artifacts - - artifacts_url=${{ github.event.workflow_run.artifacts_url }} - - gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact - do - IFS=$'\t' read name url <<< "$artifact" - gh api $url > "$name.zip" - unzip -d "$name" "$name.zip" - done - + uses: actions/download-artifact@v3 + with: + path: artifacts + github-token: ${{secrets.GITHUB_TOKEN}} + run-id: ${{ github.event.workflow_run.id }} - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 with: From 0c44d5a610654da60e029ff818f07e7fbf0d5ae0 Mon Sep 17 00:00:00 2001 From: Jakob Frank Date: Fri, 26 Apr 2024 13:20:10 +0200 Subject: [PATCH 2/2] Update and align upload and download actions --- .github/workflows/compile-test.yml | 6 +++--- .github/workflows/test-results.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compile-test.yml b/.github/workflows/compile-test.yml index b547a58..f3b01a7 100644 --- a/.github/workflows/compile-test.yml +++ b/.github/workflows/compile-test.yml @@ -23,13 +23,13 @@ jobs: cat ./target/generated-sources/license/THIRD-PARTY.txt - name: Upload Test Results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Test Results path: "**/TEST-*.xml" - name: Upload Licenses List if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Licenses List path: "./target/generated-sources/license/THIRD-PARTY.txt" @@ -67,7 +67,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Event File path: ${{ github.event_path }} \ No newline at end of file diff --git a/.github/workflows/test-results.yaml b/.github/workflows/test-results.yaml index 09cd284..5fc6117 100644 --- a/.github/workflows/test-results.yaml +++ b/.github/workflows/test-results.yaml @@ -30,7 +30,7 @@ jobs: steps: - name: Download and Extract Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: artifacts github-token: ${{secrets.GITHUB_TOKEN}}