Skip to content

Commit 16ffc4e

Browse files
authored
chore: remove mergify (#1196)
* feat: autoapprove dependabot PRs without mergify * chore: remove mergify * fix: approve dependabot PRs as OSDS bot
1 parent b47a851 commit 16ffc4e

File tree

4 files changed

+71
-46
lines changed

4 files changed

+71
-46
lines changed

Diff for: .github/workflows/automerge-approved-prs.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
pull_request_review:
3+
types: submitted
4+
5+
jobs:
6+
approved_pr:
7+
name: Automerge approved PRs
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
if: >-
12+
github.event.review.state == 'approved' &&
13+
github.event.repository == 'aws/configure-aws-credentials' &&
14+
(github.event.review.author_association == 'OWNER' || github.event.review.user.login == 'aws-sdk-osds')
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Configure AWS credentials
18+
uses: aws-actions/configure-aws-credentials@v4
19+
with:
20+
aws-region: us-west-2
21+
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
22+
role-duration-seconds: 900
23+
role-session-name: SecretsManagerFetch
24+
- name: Get bot user token
25+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
26+
with:
27+
parse-json-secrets: true
28+
secret-ids: |
29+
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
30+
- name: Enable PR automerge
31+
run: gh pr merge --auto --squash "$PR_URL"
32+
env:
33+
PR_URL: ${{ github.event.pull_request.html_url }}
34+
GITHUB_TOKEN: ${{ env.OSDS_ACCESS_TOKEN }}

Diff for: .github/workflows/dependabot-autoapprove.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Dependabot auto-approve
2+
on: pull_request
3+
permissions:
4+
pull-requests: write
5+
jobs:
6+
dependabot:
7+
runs-on: ubuntu-latest
8+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'aws/configure-aws-credentials'
9+
steps:
10+
- name: Get Metadata
11+
id: dependabot-metadata
12+
uses: dependabot/fetch-metadata@v2
13+
- uses: actions/checkout@v4
14+
name: Clone repo
15+
- name: Configure AWS credentials
16+
uses: aws-actions/configure-aws-credentials@v4
17+
with:
18+
aws-region: us-west-2
19+
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
20+
role-duration-seconds: 900
21+
role-session-name: SecretsManagerFetch
22+
- name: Get bot user token
23+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
24+
with:
25+
parse-json-secrets: true
26+
secret-ids: |
27+
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
28+
- name: Approve PR if not already approved
29+
run: |
30+
gh pr checkout "$PR_URL"
31+
if [ "$(gh pr status --json reviewDecision - q .currentBranch.reviewDecision)" != "APPROVED" ]; then
32+
gh pr review "$PR_URL" --approve
33+
else echo "PR already approved"
34+
fi
35+
env:
36+
PR_URL: ${{ github.event.pull_request.html_url }}
37+
GITHUB_TOKEN: ${{ env.OSDS_ACCESS_TOKEN }}
File renamed without changes.

Diff for: .mergify.yml

-46
This file was deleted.

0 commit comments

Comments
 (0)