Skip to content

Commit 8595802

Browse files
authored
Merge pull request #6 from atlassian-labs/ci/auto-update-readme-workflow
ci: add workflow to auto-update README.md when action.yml changes
2 parents f14bf08 + bd681e7 commit 8595802

2 files changed

Lines changed: 58 additions & 7 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update README
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "action.yml"
9+
10+
jobs:
11+
update-readme:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Update README with Rovo Dev
21+
id: rovo-dev
22+
uses: ./
23+
with:
24+
prompt: |
25+
Read the action.yml file to understand all the inputs and outputs of this GitHub Action.
26+
27+
Then, update the README.md file to ensure the documentation is in sync with action.yml:
28+
29+
1. Update the "Inputs" table to include ALL inputs defined in action.yml with their descriptions, required status, and default values
30+
2. Update the "Outputs" table to include ALL outputs defined in action.yml with their descriptions
31+
3. Update the "Features" section to mention any key capability that's not already present
32+
33+
Make sure to preserve the existing structure and formatting of the README.md file.
34+
Only make changes that are necessary to sync the documentation with action.yml.
35+
No need to add examples.
36+
atlassian_email: ${{ secrets.ATLASSIAN_EMAIL }}
37+
atlassian_token: ${{ secrets.ATLASSIAN_TOKEN }}
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
create_pr: "true"
40+
pr_title: "docs: Update README.md to sync with action.yml"
41+
pr_body: |
42+
## Automated Documentation Update
43+
44+
This PR was automatically generated to keep README.md in sync with action.yml.
45+
46+
**Triggered by:** Commit to main branch that modified action.yml
47+
**Workflow Run:** ${{ github.run_id }}
48+
49+
Please review the changes to ensure the documentation accurately reflects the action's capabilities.
50+
pr_base_branch: main
51+
branch_prefix: docs/readme-sync
52+
53+
- name: Output Results
54+
run: |
55+
echo "Exit Code: ${{ steps.rovo-dev.outputs.exit_code }}"
56+
echo "PR Created: ${{ steps.rovo-dev.outputs.pr_created }}"
57+
echo "PR URL: ${{ steps.rovo-dev.outputs.pr_url }}"
58+
echo "Branch Name: ${{ steps.rovo-dev.outputs.branch_name }}"

scripts/create-pr.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ if [ -z "$BRANCH_NAME" ] || [ -z "$BASE_BRANCH" ]; then
1414
exit 1
1515
fi
1616

17-
# Check if there are any changes to commit
18-
if git diff --quiet && git diff --staged --quiet; then
19-
echo "No changes detected. Skipping PR creation."
20-
echo "pr_created=false" >> "$GITHUB_OUTPUT"
21-
exit 0
22-
fi
23-
2417
# Stage all changes
2518
git add -A
2619

0 commit comments

Comments
 (0)