Skip to content

Commit 848eb2d

Browse files
authored
fix: Update dist-pr.yml (#214)
Updates to: Checks out the dist branch (which now contains the new commit with the updated dist/samples content). Uses gh pr create --base main --head dist to create a pull request. gh now correctly sees the difference between the dist branch (with its new commit) and main.
1 parent aa157d7 commit 848eb2d

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

.github/workflows/dist-pr.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,47 +27,20 @@ jobs:
2727
uses: actions/checkout@v3
2828
with:
2929
token: ${{ secrets.GH_MERGE_TOKEN }}
30-
fetch-depth: 0 # Fetch all history
30+
fetch-depth: 0
3131

3232
- name: Set Git Identity
3333
run: |
3434
git config --global user.name 'googlemaps-bot'
3535
git config --global user.email '[email protected]'
36-
37-
- name: Aggressively clean Workspace
38-
run: |
39-
git reset --hard
40-
git clean -fdx
41-
ls -la # List all files (including hidden ones)
42-
43-
- name: List contents of dist
44-
run: |
45-
git fetch origin dist
46-
git checkout origin/dist
47-
ls -la dist
48-
49-
- name: Create Branch for PR
50-
run: |
51-
git fetch origin main
52-
git checkout -b dist-to-main-pr
5336
5437
- name: Create Pull Request
5538
run: |
5639
gh pr create \
5740
--base main \
58-
--head dist-to-main-pr \
41+
--head dist \
5942
--title "chore: automated output update (dist)" \
6043
--body "This PR contains updated build output from the dist branch." \
6144
--label "automated pr,dist-update"
6245
env:
6346
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
64-
65-
- name: Check for Existing PR and Close (Optional)
66-
run: |
67-
EXISTING_PR=$(gh pr list --base main --head dist-to-main-pr --state open --json number -q '.[].number')
68-
if [[ -n "$EXISTING_PR" ]]; then
69-
echo "Found existing open PR(s) for dist-to-main-pr: $EXISTING_PR"
70-
gh pr close "$EXISTING_PR"
71-
fi
72-
env:
73-
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}

0 commit comments

Comments
 (0)