Skip to content
Closed
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
49 changes: 49 additions & 0 deletions .github/workflows/automated_approval_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Auto approve PRs by Tagging Bot

on:
pull_request:
types: [opened, synchronize, labeled] # ← Fixed: Added 'labeled'

# add permission to read contents
permissions:
contents: write
pull-requests: write
issues: write

jobs:
auto-approve:
runs-on:
group: databricks-deco-testing-runner-group
labels: ubuntu-latest-deco
environment: "release-is" # Required to access GitHub App secrets
permissions:
pull-requests: write
contents: read

steps:
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.DECO_SDK_TAGGING_APP_ID }}
private-key: ${{ secrets.DECO_SDK_TAGGING_PRIVATE_KEY }}

# Optional: Debug step to see who the author is
- name: Debug PR Info
run: |
echo "PR Number: ${{ github.event.pull_request.number }}"
echo "PR Author: ${{ github.event.pull_request.user.login }}"
echo "PR Labels: ${{ toJson(github.event.pull_request.labels.*.name) }}"
echo "Trigger Event: ${{ github.event.action }}"

- name: Approve PR based on conditions
if: |
github.event.pull_request.user.login == 'deco-sdk-tagging[bot]' ||
contains(github.event.pull_request.labels.*.name, 'zzz:automated-update')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr review ${{ github.event.pull_request.number }} \
--repo ${{ github.repository }} \
--approve \
--body "Auto-approved by Databricks SDK Release Bot"
Loading