Skip to content
Merged
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
56 changes: 37 additions & 19 deletions .github/workflows/dist-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,41 @@ on:

jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_MERGE_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_MERGE_TOKEN }}
fetch-depth: 0 # Fetch all history

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_MERGE_TOKEN }}
commit-message: 'chore: automated output update (dist)'
title: 'chore: automated output update (dist)'
body: 'This PR contains updated build output from the dist branch.'
branch: 'dist-to-main-pr' # PR branch
base: main # Target branch
labels: |
automated pr
dist-update
draft: false # Or true, if you want to review before enabling auto-merge
- name: Set Git Identity
run: |
git config --global user.name 'googlemaps-bot'
git config --global user.email '[email protected]'

- name: Create Branch for PR
run: |
git fetch origin main
git checkout -b dist-to-main-pr origin/dist

- name: Create Pull Request
run: |
gh pr create \
--base main \
--head dist-to-main-pr \
--title "chore: automated output update (dist)" \
--body "This PR contains updated build output from the dist branch." \
--label "automated pr,dist-update"
env:
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}

- name: Check for Existing PR and Close (Optional)
run: |
EXISTING_PR=$(gh pr list --base main --head dist-to-main-pr --state open --json number -q '.[].number')
if [[ -n "$EXISTING_PR" ]]; then
echo "Found existing open PR(s) for dist-to-main-pr: $EXISTING_PR"
gh pr close "$EXISTING_PR"
fi
env:
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}