Skip to content

Commit 3bf6d58

Browse files
brody-0125claude
andauthored
Switch data collection workflows to use pull requests instead of direct commits (#4)
* fix: replace git-auto-commit-action with create-pull-request The git-auto-commit-action fails because branch protection rules on main require changes through pull requests. Replace with peter-evans/create-pull-request which creates/updates a PR instead of pushing directly to the protected branch. https://claude.ai/code/session_01AhJryv2HXYf5uGoT4kFQYH * feat: enable auto-merge for data collection PRs Add gh pr merge --auto --squash step after PR creation so data collection PRs merge automatically once branch protection checks pass. https://claude.ai/code/session_01AhJryv2HXYf5uGoT4kFQYH * chore: change realtime collection interval from 5min to 15min https://claude.ai/code/session_01AhJryv2HXYf5uGoT4kFQYH --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 78f2af5 commit 3bf6d58

2 files changed

Lines changed: 35 additions & 9 deletions

File tree

.github/workflows/collect-realtime.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ name: Collect Realtime Facility Status
22

33
on:
44
schedule:
5-
- cron: '*/5 * * * *'
5+
- cron: '*/15 * * * *'
66
workflow_dispatch:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
collect:
@@ -36,8 +37,20 @@ jobs:
3637
run: node build-latest.js
3738
working-directory: scripts
3839

39-
- name: Commit data
40-
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5
40+
- name: Create pull request with data
41+
id: cpr
42+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
4143
with:
42-
commit_message: 'chore: collect realtime data'
43-
file_pattern: 'data/** web/public/data/**'
44+
commit-message: 'chore: collect realtime data'
45+
branch: auto/collect-realtime
46+
title: 'chore: collect realtime data'
47+
body: 'Automated realtime facility data collection.'
48+
add-paths: |
49+
data/**
50+
web/public/data/**
51+
52+
- name: Enable auto-merge
53+
if: steps.cpr.outputs.pull-request-number
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash

.github/workflows/collect-static.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
collect-static:
@@ -36,8 +37,20 @@ jobs:
3637
run: node build-latest.js || echo "Skipped (no realtime data yet)"
3738
working-directory: scripts
3839

39-
- name: Commit data
40-
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5
40+
- name: Create pull request with data
41+
id: cpr
42+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
4143
with:
42-
commit_message: 'chore: update static facility data'
43-
file_pattern: 'data-static/** web/public/data/**'
44+
commit-message: 'chore: update static facility data'
45+
branch: auto/collect-static
46+
title: 'chore: update static facility data'
47+
body: 'Automated static facility data collection.'
48+
add-paths: |
49+
data-static/**
50+
web/public/data/**
51+
52+
- name: Enable auto-merge
53+
if: steps.cpr.outputs.pull-request-number
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash

0 commit comments

Comments
 (0)