Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/dependabot-automerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: 'Dependabot Auto-Merge'
on:
workflow_dispatch:
schedule:
- cron: '00 01 * * *' # trigger daily at 01:00 a.m.
- cron: '13 10 * * *' # trigger daily at 10:13

env:
DEPENDABOT_GROUPS: |
production-major group
production-minor-patch group
plugins group
test group
Expand All @@ -15,25 +16,23 @@ jobs:
review-prs:
runs-on: ubuntu-latest
permissions:
contents: read
contents: read # all write operations use app token
steps:
- name: Generate GitHub App token
- name: 'Create GitHub App Token'
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.SAP_AI_SDK_BOT_CLIENT_ID }}
private-key: ${{ secrets.SAP_AI_SDK_BOT_PRIVATE_KEY }}
owner: SAP
repositories: ai-sdk-java
permission-pull-requests: write
permission-contents: write
permission-pull-requests: write

- name: Checkout
uses: actions/checkout@v7

- name: Approve and Merge PRs
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: 'Approve and Merge PRs'
run: |
PRS=$(gh pr list --app "dependabot" --state "open" --json number,title)
PR_NUMBERS=
Expand All @@ -53,8 +52,10 @@ jobs:
if [[ -z "$PR_NUMBER" ]]; then
continue
fi

echo "[DEBUG] Approving and Merging PR #$PR_NUMBER"
gh pr merge "$PR_NUMBER" --auto --squash
gh pr review "$PR_NUMBER" --approve
done <<< "$PR_NUMBERS"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}