Skip to content

Commit

Permalink
Merge pull request #354 from matysek/mzibrick-ccxdev14176
Browse files Browse the repository at this point in the history
[CCXDEV-14176] GH actions: add konflux PR automerging
  • Loading branch information
matysek authored Oct 10, 2024
2 parents 070fe52 + 3d9bb7a commit 5bd856e
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/bots-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,25 @@ permissions:
jobs:
bot-automerge:
runs-on: ubuntu-latest
# Check the pull request author.
if: |
github.actor == 'red-hat-konflux[bot]' ||
github.actor == 'dependabot[bot]' ||
github.actor == 'InsightsDroid'
github.event.pull_request.user.login == 'dependabot[bot]' ||
github.event.pull_request.user.login == 'red-hat-konflux[bot]' ||
github.event.pull_request.user.login == 'InsightsDroid'
steps:
# NOTE: PR approval does not work on PRs from forks
- name: Github Actions bot approves the PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{ github.token }}
- name: InsightsDroid approves the PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.INSIGHTSDROID_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
# We can filter depending on the semver major, minor, or patch updates,
# but let's not do it for now
# - name: Dependabot metadata
# id: metadata
# uses: dependabot/fetch-metadata@v1
# with:
# github-token: "${{ secrets.GITHUB_TOKEN }}"
# if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
- name: Enable auto-merge for PR
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{ github.token }}

0 comments on commit 5bd856e

Please sign in to comment.