diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 9c7d63f..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "nuget" # See documentation for possible values - directory: "/source/" # Location of package manifests - schedule: - interval: "daily" - open-pull-requests-limit: 1 - cooldown: - default-days: 3 diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml deleted file mode 100644 index 99bf071..0000000 --- a/.github/workflows/dependabot-automerge.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: "Dependabot Approve and Auto Merge" - -on: - pull_request: - branches: [ main ] - -# Increase the access for the GITHUB_TOKEN -permissions: - # This Allows the GITHUB_TOKEN to approve pull requests - pull-requests: write - # This Allows the GITHUB_TOKEN to auto merge pull requests - contents: write - -env: - PR_URL: ${{github.event.pull_request.html_url}} - # By default, GitHub Actions workflows triggered by Dependabot get a GITHUB_TOKEN with read-only permissions. - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ (github.actor == 'dependabot[bot]') && (contains(github.head_ref, 'dependabot')) }} - steps: - - name: Approve a dependabot created PR - run: gh pr review --approve "$PR_URL" - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --squash "$PR_URL" diff --git a/.github/workflows/renovate-approve-pr.yaml b/.github/workflows/renovate-approve-pr.yaml new file mode 100644 index 0000000..0d0b6df --- /dev/null +++ b/.github/workflows/renovate-approve-pr.yaml @@ -0,0 +1,27 @@ +name: "Approve and auto-merge Renovate Pull Requests with automerge label" + +on: + pull_request: + branches: + - main + +env: + PR_URL: ${{github.event.pull_request.html_url}} + # By default, the GitHub Actions workflow will get a GITHUB_TOKEN with read-only permissions. + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + +permissions: + # This Allows the GITHUB_TOKEN to approve pull requests + pull-requests: write + # This Allows the GITHUB_TOKEN to auto merge pull requests + contents: write + +jobs: + approve-pr: + runs-on: ubuntu-latest + if: ${{ (github.actor == 'team-builds-bot') && contains(github.event.pull_request.labels.*.name, 'autoapprove') }} + steps: + - name: Approve a renovate PR with the 'autoapprove' label + run: gh pr review --approve "$PR_URL" + - name: Enable auto-merge for the PR + run: gh pr merge --auto --squash "$PR_URL" diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 0000000..29079f0 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,30 @@ +name: Renovate Update dependencies +on: + schedule: + - cron: "20 10 * * *" + pull_request: # limit this to run on PRs that modify Renovate config files + paths: + - ".github/workflows/renovate.yaml" + - "renovate.json" + push: + branches: + - main + paths: + - ".github/workflows/renovate.yaml" + - "renovate.json" +jobs: + renovate: + name: Check Dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Run Renovate + uses: renovatebot/github-action@v46.1.19 + with: + token: ${{ secrets.RENOVATE_GITHUB_TOKEN }} + configurationFile: renovate.json + env: + RENOVATE_REPOSITORIES: ${{ github.repository }} + LOG_LEVEL: ${{ github.ref_name == 'main' && 'INFO' || 'DEBUG' }} + RENOVATE_BASE_BRANCHES: ${{ github.event.pull_request.head.ref || 'main' }} diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..b8756a2 --- /dev/null +++ b/renovate.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "labels": [ + "dependencies", + "autoapprove", + "{{datasource}}" + ], + "rebaseWhen": "conflicted", + "dependencyDashboard": true, + "dependencyDashboardTitle": "Renovate Dependency Dashboard", + "dependencyDashboardHeader": "This dashboard manages dependencies for the default branch.", + "dependencyDashboardOSVVulnerabilitySummary": "all", + "assigneesFromCodeOwners": true, + "prConcurrentLimit": 1, + "minimumReleaseAge": "3 days" +}