Skip to content

Commit

Permalink
chore: remove mergify (#1196)
Browse files Browse the repository at this point in the history
* feat: autoapprove dependabot PRs without mergify

* chore: remove mergify

* fix: approve dependabot PRs as OSDS bot
  • Loading branch information
kellertk authored Nov 5, 2024
1 parent b47a851 commit 16ffc4e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 46 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/automerge-approved-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request_review:
types: submitted

jobs:
approved_pr:
name: Automerge approved PRs
permissions:
contents: write
pull-requests: write
if: >-
github.event.review.state == 'approved' &&
github.event.repository == 'aws/configure-aws-credentials' &&
(github.event.review.author_association == 'OWNER' || github.event.review.user.login == 'aws-sdk-osds')
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
role-duration-seconds: 900
role-session-name: SecretsManagerFetch
- name: Get bot user token
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: |
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
- name: Enable PR automerge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ env.OSDS_ACCESS_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/dependabot-autoapprove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Dependabot auto-approve
on: pull_request
permissions:
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'aws/configure-aws-credentials'
steps:
- name: Get Metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
- uses: actions/checkout@v4
name: Clone repo
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
role-duration-seconds: 900
role-session-name: SecretsManagerFetch
- name: Get bot user token
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: |
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
- name: Approve PR if not already approved
run: |
gh pr checkout "$PR_URL"
if [ "$(gh pr status --json reviewDecision - q .currentBranch.reviewDecision)" != "APPROVED" ]; then
gh pr review "$PR_URL" --approve
else echo "PR already approved"
fi
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ env.OSDS_ACCESS_TOKEN }}
File renamed without changes.
46 changes: 0 additions & 46 deletions .mergify.yml

This file was deleted.

0 comments on commit 16ffc4e

Please sign in to comment.