Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions .github/workflows/approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ on:
- synchronize
- reopened
branches:
- main # Only trigger for PRs targeting main
paths: # Optional but recommended: only trigger for changes in specific parts of the repo
- 'dist/**'
- main

jobs:
approve-and-merge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'googlemaps-bot[bot]' && github.event.pull_request.head.ref == 'dist-to-main-pr'
if: github.event.pull_request.user.login == 'googlemaps-bot[bot]' && github.event.pull_request.head.ref == 'temp-build-branch' # change here
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout the PR's head commit
ref: ${{ github.event.pull_request.head.ref }} # Checkout the PR's head commit
token: ${{ secrets.GH_MERGE_TOKEN }}

- name: Approve PR
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/dist-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@ jobs:
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 \
--head temp-build-branch \
--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 temp-build-branch --state open --json number -q '.[].number')
if [[ -n "$EXISTING_PR" ]]; then
echo "Found existing open PR(s) for temp-build-branch: $EXISTING_PR"
gh pr close "$EXISTING_PR"
fi
env:
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Checkout main
uses: actions/checkout@v3
with:
ref: main # Checkout *main* initially
ref: main
token: ${{ secrets.GH_MERGE_TOKEN }}
fetch-depth: 0

Expand Down Expand Up @@ -64,17 +64,11 @@ jobs:
- name: Deploy to Firebase Hosting
run: firebase deploy --only hosting

- name: Checkout dist branch
run: git checkout -B dist origin/dist || git checkout -b dist
- name: Create temporary branch
run: git checkout -b temp-build-branch

- name: Prepare dist folder
- name: Commit and Push Changes (to temp branch)
run: |
rm -rf samples
mkdir -p dist
cp -r ./dist/* ./dist/

- name: Commit and Push Changes (to dist)
run: |
git add .
git add dist
git commit -m "Update dist folder"
git push --force origin dist
git push --force origin temp-build-branch