diff --git a/.github/workflows/auto-approver.yaml b/.github/workflows/auto-approver.yaml new file mode 100644 index 00000000..4f8b24ad --- /dev/null +++ b/.github/workflows/auto-approver.yaml @@ -0,0 +1,25 @@ +name: auto-approver +run-name: CI for approving PRs + +on: + push: + branches: + - "renovate/**" + +jobs: + autoapprove: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 + - name: Approve PR + run: | + gh pr review --approve || true + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} + - name: Enable automerge if required + run: | + if [[ $(gh pr view --json body | grep "\*\*Automerge\*\*: Enabled") ]]; then + gh pr merge --auto --merge || true + fi + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/renovate-approve.yaml b/.github/workflows/renovate-approve.yaml deleted file mode 100644 index c70e7910..00000000 --- a/.github/workflows/renovate-approve.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: renovate-approve -run-name: CI for approving renovate PRs - -on: - push: - branches: - - "renovate/**" - -jobs: - autoapprove: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Approve PR - run: | - gh pr review --approve || true - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml deleted file mode 100644 index cf772756..00000000 --- a/.github/workflows/renovate.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# workflow for checking package versions and opening PRs to bump -name: Renovate -on: - workflow_dispatch: - workflow_call: - -jobs: - renovate: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Self-hosted Renovate - uses: renovatebot/github-action@23a02fe7be9e93f857a953cc8162e57d2c8401ef # v39.0.1 - with: - configurationFile: renovate-config.js - token: ${{ secrets.PAT_TOKEN }} diff --git a/renovate-config.js b/renovate-config.js deleted file mode 100644 index 17faa303..00000000 --- a/renovate-config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - branchPrefix: 'renovate/', - dryRun: null, - username: 'renovate-release', - gitAuthor: 'Renovate Bot ', - onboarding: true, - platform: 'github', - includeForks: true, - repositories: ['canonical/hydra-rock'], -}