-
Notifications
You must be signed in to change notification settings - Fork 7
Add CI automation for automatic Beman docs import #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
neatudarius
wants to merge
43
commits into
bemanproject:main
Choose a base branch
from
neatudarius:test/sync-docs-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+188
−0
Draft
Changes from 19 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
93d67eb
Add CI automation for automatic Beman docs import
fc5c628
Tweaks
e428d0f
Tweaks
4310530
Tweaks
2d55b53
Tweaks
9f8201a
Test: Add PR testing support to sync-docs workflow
a9c4250
Add test mode for PR creation in sync-docs workflow
05d5b68
Use unique branch name format: website-weekly-docs-import-yyyy-mm-dd
3c0411a
Fix: Clean up beman directory and handle PR permission limitations
8b2cff9
Add workflow_dispatch input for test mode
ac9553a
Add debug info and repository settings check for workflow_dispatch
eacee61
Add support for Personal Access Token (PAT) to fix permission issues
9f02335
Improve PAT detection and instructions
b687a4f
Add better PAT detection and error messages
be37714
Clean up workflow: remove test/debug code, keep only production funct…
4d8fd67
Add back Show changes step with git status and git diff
11bccda
Add back pull_request trigger so workflow runs on PRs
50e26b5
Allow PR creation on PRs when PAT is available
54f5d12
Add repository_dispatch trigger for on-demand API triggering
bc70e5e
Update .github/workflows/sync-docs.yml
neatudarius cfc912d
Update .github/workflows/sync-docs.yml
neatudarius f075c11
Update .github/workflows/sync-docs.yml
neatudarius 9889e4f
Add SPDX identifier
4a29520
Fail fatal if PAT is missing when running on PRs
b393851
Add comprehensive debug section before Create Pull Request step
ee01cd9
Trigger workflow run
9721372
Move debug section earlier in workflow (after branch name generation)
c019525
Move Show changes step right after Generate branch name
03acade
Trigger workflow run to test GH_PAT
48033e2
Re-test workflow with GH_PAT secret
adbaa04
Trigger workflow run again
9bb9c56
Trigger workflow run
ee0dc4c
Update PR title to include date and review request
72d7bf2
Update PR: set assignee to neatudarius, add reviewers, and link to is…
1544255
Fix issue reference text: 'automatic docs import'
906bee9
Change 'Evergreen' to 'evergreen' (lowercase)
ed9c751
Simplify workflow: keep only schedule trigger, remove manual triggers…
692aef4
Add comprehensive documentation explaining workflow purpose, schedule…
e8494e6
Optimize checkout: change fetch-depth from 0 to 1 for better performance
5fd264f
Remove unnecessary cleanup step - GitHub Actions runners auto-cleanup…
29d3785
Make error message more generic: clarify repository Settings location
7adddaa
Make assignees and reviewers configurable via repository variables wi…
5d59528
Add workflow_dispatch and repository_dispatch triggers for manual tes…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Auto-sync Beman Docs | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pull_request: | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| workflow_call: | ||
| workflow_dispatch: | ||
| repository_dispatch: | ||
| types: | ||
| - sync-docs | ||
| schedule: | ||
| - cron: '0 6 * * MON' # 09:00 Romania time | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
neatudarius marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout website repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Checkout beman repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: bemanproject/beman | ||
| path: beman | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.x' | ||
|
|
||
| - name: Run sync-docs.py | ||
| run: | | ||
| python3 scripts/sync-docs.py beman | ||
|
|
||
| - name: Clean up beman directory | ||
| run: | | ||
| rm -rf beman | ||
|
|
||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Generate branch name | ||
| id: branch-name | ||
| run: | | ||
| BRANCH_NAME="website-weekly-docs-import-$(date +%Y-%m-%d)" | ||
| echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT | ||
| echo "Generated branch name: $BRANCH_NAME" | ||
|
|
||
| - name: Show changes | ||
| run: | | ||
| echo "=== Changes detected ===" | ||
| git status | ||
| echo "" | ||
| echo "=== Diff ===" | ||
| git diff || echo "No changes detected" | ||
|
|
||
| - name: Check if PAT is available | ||
| id: check-pat | ||
| run: | | ||
| if [ -n "${{ secrets.GH_PAT }}" ]; then | ||
| echo "pat_available=true" >> $GITHUB_OUTPUT | ||
| echo "✅ GH_PAT secret is available - will use it for PR creation" | ||
| else | ||
| echo "pat_available=false" >> $GITHUB_OUTPUT | ||
| echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN (limited permissions on PRs)" | ||
| fi | ||
|
|
||
| - name: Create Pull Request | ||
| if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} | ||
| base: main | ||
| commit-message: "Auto-sync documentation from latest content of bemanproject/beman" | ||
| branch: ${{ steps.branch-name.outputs.branch_name }} | ||
| title: "Weekly docs sync" | ||
| body: | | ||
| Automated sync of documentation and images from latest content of bemanproject/beman. | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Triggered by the weekly schedule. | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| labels: | | ||
| sync | ||
| automation | ||
| author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | ||
neatudarius marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| assignees: | | ||
neatudarius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| neatudarius | ||
| RaduNichita | ||
| mguludag | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.