Skip to content

Commit

Permalink
ci: enable auto-merge GH Action
Browse files Browse the repository at this point in the history
rhel-only

Related: RHEL-1087
  • Loading branch information
jamacku committed Nov 3, 2023
1 parent 36266d3 commit 1425e71
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
labels:
dont-merge: dont-merge
manual-merge: pr/needs-manual-merge
target-branch': ['main']
14 changes: 14 additions & 0 deletions .github/workflows/source-git-automation-on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
pr-number: ${{ inputs.pr-number == 0 && fromJSON(needs.gather-pull-requests.outputs.pr-numbers) || fromJSON(needs.gather-pull-requests.outputs.pr-numbers-manual) }}

permissions:
contents: write
statuses: write
checks: write
pull-requests: write
Expand Down Expand Up @@ -103,3 +104,16 @@ jobs:
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

- id: auto-merge
name: Auto Merge
uses: redhat-plumbers-in-action/auto-merge@v1
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
tracker: ${{ fromJSON(steps.commit-linter.outputs.validated-pr-metadata).validation.tracker.id }}
tracker-type: ${{ fromJSON(steps.commit-linter.outputs.validated-pr-metadata).validation.tracker.type }}
bugzilla-instance: https://bugzilla.redhat.com
bugzilla-api-token: ${{ secrets.BUGZILLA_API_TOKEN }}
jira-instance: https://issues.redhat.com
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/source-git-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,25 @@ jobs:
with:
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

auto-merge:
needs: [ download-metadata, commit-linter, tracker-validator, pull-request-validator ]
runs-on: ubuntu-latest

permissions:
contents: write
checks: write
pull-requests: write

steps:
- name: Auto Merge
uses: redhat-plumbers-in-action/auto-merge@v1
with:
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }}
tracker: ${{ fromJSON(needs.commit-linter.outputs.validated-pr-metadata).validation.tracker.id }}
tracker-type: ${{ fromJSON(needs.commit-linter.outputs.validated-pr-metadata).validation.tracker.type }}
bugzilla-instance: https://bugzilla.redhat.com
bugzilla-api-token: ${{ secrets.BUGZILLA_API_TOKEN }}
jira-instance: https://issues.redhat.com
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1425e71

Please sign in to comment.