From 9801703a1be4594b98634e099c9b384541e1a30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 13 Oct 2023 16:54:53 +0200 Subject: [PATCH] CI updates This is done by the automated script named upgrade-c2cciutils-to-1.7 --- .github/renovate.json5 | 10 +++++--- .github/run-changelog.mjs | 13 ---------- .github/workflows/dependency-auto-review.yaml | 25 +++++++++++++++++++ .../workflows/dependency-update-review.yaml | 22 ---------------- .github/workflows/main.yaml | 16 +++++++++--- 5 files changed, 44 insertions(+), 42 deletions(-) delete mode 100644 .github/run-changelog.mjs create mode 100644 .github/workflows/dependency-auto-review.yaml delete mode 100644 .github/workflows/dependency-update-review.yaml diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 11e4e7e..91805be 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -17,10 +17,12 @@ }, 'pre-commit': { enabled: true }, regexManagers: [ + /** Do updates on pre-commit additional dependencies */ { - fileMatch: ['^\\.pre-commit-config\\.yaml$'], + fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'], matchStrings: [" +- '?(?[^' @=]+)(@|==)(?[^' @=]+)'? # (?.+)"], }, + /** Do update on the schema present in the ci/config.yaml */ { fileMatch: ['^ci/config\\.yaml$'], matchStrings: [ @@ -30,22 +32,24 @@ }, ], packageRules: [ - /** Automerge the patch, the minor and the dev dependency */ + /** Auto merge the dev dependency update */ { matchDepTypes: ['devDependencies'], automerge: true, }, - /** Group the patch and the minor */ + /** Group and auto merge the patch updates */ { matchUpdateTypes: ['patch'], groupName: 'all patch versions', automerge: true, }, + /** Group and auto merge the minor updates */ { matchUpdateTypes: ['minor'], groupName: 'all minor versions', automerge: true, }, + /** Support the 4 parts of shellcheck-py version with a v prefix */ { matchPackageNames: ['shellcheck-py/shellcheck-py'], versioning: 'regex:^v(?\\d+)\\.(?\\d+)\\.(?\\d+)\\.(?\\d+)$', diff --git a/.github/run-changelog.mjs b/.github/run-changelog.mjs deleted file mode 100644 index 937b447..0000000 --- a/.github/run-changelog.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import { Octokit } from '@octokit/action'; - -if (process.env.GITHUB_REF_TYPE == 'tag') { - console.log('Run changelog'); - - const octokit = new Octokit(); - - await octokit.rest.repos.createDispatchEvent({ - owner: 'camptocamp', - repo: 'helm-mutualize', - event_type: 'changelog', - }); -} diff --git a/.github/workflows/dependency-auto-review.yaml b/.github/workflows/dependency-auto-review.yaml new file mode 100644 index 0000000..d097190 --- /dev/null +++ b/.github/workflows/dependency-auto-review.yaml @@ -0,0 +1,25 @@ +name: Auto reviews updates + +on: + pull_request: + types: + - opened + - reopened + +jobs: + auto-merge: + name: Auto reviews updates + runs-on: ubuntu-22.04 + timeout-minutes: 5 + + steps: + - uses: actions/github-script@v6 + with: + script: |- + github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + event: 'APPROVE', + }) + if: github.event.pull_request.user.login == 'renovate[bot]' diff --git a/.github/workflows/dependency-update-review.yaml b/.github/workflows/dependency-update-review.yaml deleted file mode 100644 index 2d6c98e..0000000 --- a/.github/workflows/dependency-update-review.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Auto reviews updates - -on: - pull_request: - types: - - opened - - reopened - - synchronize - -jobs: - auto-merge: - name: Auto reviews updates - runs-on: ubuntu-22.04 - timeout-minutes: 5 - - steps: - - name: Auto reviews updates - uses: golfzaptw/action-auto-reviews-from-branches@1.2.3 - with: - GITHUB_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }} - AUTHOR: renovate[bot] - if: github.event.pull_request.user.login == 'renovate[bot]' diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 52e1246..2078057 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -80,9 +80,17 @@ jobs: run: c2cciutils-publish if: matrix.helm == 'latest' - - name: Install octokit/action - run: npm install @octokit/action - - name: Run changelog - run: node .github/run-changelog.mjs + - name: Trigger changelog workflow env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/github-script@v6 + with: + script: |- + if (process.env.GITHUB_REF_TYPE == 'tag') { + console.log('Trigger changelog'); + await github.rest.repos.createDispatchEvent({ + owner: 'camptocamp', + repo: 'helm-mutualize', + event_type: 'changelog', + }); + }