Skip to content

Commit f3a6588

Browse files
authored
feat: remove draft PR, add auto-merge on success (#10)
1 parent 890b3f0 commit f3a6588

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/autoupdate.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
ref: ${{ github.repository }}
5555
branch: ${{ env.AUTOUPDATE_BRANCH }}
5656
builds-and-checks: |
57-
npm run build
58-
npm test
57+
npm run build
58+
npm test
5959
debug: "true"
6060
ignore-packages: |
61-
@types/node
61+
@types/node
6262
- name: Persist autoupdater work on failure
6363
if: steps.autoupdate.outcome == 'failure'
6464
run: |
@@ -128,7 +128,15 @@ jobs:
128128
--assignee siarheidudko \
129129
--reviewer siarheidudko)
130130
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
131-
- name: Open draft PR (autoupdater failed)
131+
- name: Enable auto-merge on success PR
132+
if: steps.pr_success.outputs.pr_url != ''
133+
env:
134+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135+
PR_URL: ${{ steps.pr_success.outputs.pr_url }}
136+
run: |
137+
gh api repos/${{ github.repository }} --method PATCH -f allow_auto_merge=true || true
138+
gh pr merge "$PR_URL" --auto --squash || true
139+
- name: Open PR (autoupdater failed)
132140
id: pr_failure
133141
if: steps.autoupdate.outcome == 'failure' && steps.diff.outputs.has_diff == 'true'
134142
env:
@@ -143,8 +151,8 @@ jobs:
143151
A Claude session has been dispatched to push fixes onto this branch
144152
so the following commands all exit 0:
145153
146-
npm run build
147-
npm test
154+
npm run build
155+
npm test
148156
149157
Claude will leave a status comment on this PR when it finishes.
150158
PR-checks will re-run on each new commit.
@@ -155,7 +163,6 @@ jobs:
155163
--head "$AUTOUPDATE_BRANCH" \
156164
--title "chore(deps): autoupdate (needs claude fix)" \
157165
--body "$BODY" \
158-
--draft \
159166
--assignee siarheidudko \
160167
--reviewer siarheidudko)
161168
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)