Skip to content

Commit da0cd1f

Browse files
committed
feat: Automatically open PR. Automatically post status update to the issue
1 parent f40e8ef commit da0cd1f

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

.github/workflows/resource-request.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,33 @@ jobs:
1212
permissions:
1313
contents: write
1414
issues: write
15+
pull-requests: write
1516
id-token: write
1617
outputs:
1718
branch-name: ${{ steps.create-branch.outputs.branch-name }}
1819
resource-name: ${{ steps.extract-info.outputs.resource-name }}
1920

2021
steps:
22+
- name: Post processing comment
23+
uses: actions/github-script@v7
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
script: |
27+
await github.rest.issues.createComment({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
issue_number: context.issue.number,
31+
body: [
32+
'## 🚧 Processing Resource Request',
33+
'',
34+
'Thanks for the request! We\'re on it — your resource is being automatically built and tested.',
35+
'',
36+
'Expected timeline: the resource will be built, tested, and merged within ~1 week.',
37+
'',
38+
'We\'ll post another update here once it\'s ready for review.',
39+
].join('\n')
40+
})
41+
2142
- uses: actions/checkout@v4
2243
with:
2344
token: ${{ secrets.GITHUB_TOKEN }}
@@ -57,10 +78,6 @@ jobs:
5778
git config user.name "github-actions[bot]"
5879
git config user.email "github-actions[bot]@users.noreply.github.com"
5980
60-
- name: Make a change
61-
run: |
62-
touch temp-file.md
63-
6481
# - name: Generate resource with Claude (research + implement)
6582
# uses: anthropics/claude-code-action@v1
6683
# with:
@@ -147,6 +164,21 @@ jobs:
147164
echo "No changes were generated — failing the workflow."
148165
exit 1
149166
167+
- name: Open pull request
168+
if: steps.auto-commit.outputs.changes_detected == 'true'
169+
env:
170+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171+
run: |
172+
gh pr create \
173+
--title "feat: Add ${{ steps.extract-info.outputs.resource-name }} resource" \
174+
--body "Closes #${{ github.event.issue.number }}
175+
176+
Auto-generated resource from issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
177+
178+
> ⚠️ This PR was generated by AI. Please review carefully before merging." \
179+
--base main \
180+
--head resource-request/${{ steps.extract-info.outputs.resource-name }}
181+
150182
# ── Job 2: Integration tests on Linux ────────────────────────────────────
151183
test-linux:
152184
needs: generate-resource

0 commit comments

Comments
 (0)