From 93d67ebb94a2bb27fec7017b344cc4cf40844bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 9 Dec 2025 02:12:08 +0200 Subject: [PATCH 01/44] Add CI automation for automatic Beman docs import --- .github/workflows/sync-docs.yml | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/sync-docs.yml diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml new file mode 100644 index 0000000..818bf50 --- /dev/null +++ b/.github/workflows/sync-docs.yml @@ -0,0 +1,56 @@ +name: Auto-sync Beman Docs + +on: + push: + branches: + - main + pull_request: + workflow_call: + workflow_dispatch: + schedule: + - cron: '0 6 * * MON' # 09:00 AM EEST (neatudarius' timezone) + +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 + + - 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: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "Auto-sync documentation from latest content of bemanproject/beman" + branch: auto/sync-docs + title: "Weekly docs sync" + body: | + Automated sync of documentation and images from latest content of bemanproject/beman. + Triggered by weekly schedule at 09:00 EEST. + labels: sync, automation + author: "github-actions[bot] " + assignees: | + neatudarius + RaduNichita + mguludag From fc5c62800300f561f1e9ef38b8fd0b78f7247e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 9 Dec 2025 02:16:45 +0200 Subject: [PATCH 02/44] Tweaks --- .github/workflows/sync-docs.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 818bf50..7b4c3c6 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -8,7 +8,8 @@ on: workflow_call: workflow_dispatch: schedule: - - cron: '0 6 * * MON' # 09:00 AM EEST (neatudarius' timezone) + # 09:00 EEST/EET ≈ 06:00 UTC + - cron: '0 6 * * MON' permissions: contents: write @@ -47,8 +48,10 @@ jobs: title: "Weekly docs sync" body: | Automated sync of documentation and images from latest content of bemanproject/beman. - Triggered by weekly schedule at 09:00 EEST. - labels: sync, automation + Triggered by the weekly schedule. + labels: | + sync + automation author: "github-actions[bot] " assignees: | neatudarius From e428d0f8cdd007b8ef8f1d40df0262aab10c12b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 9 Dec 2025 02:18:32 +0200 Subject: [PATCH 03/44] Tweaks --- .github/workflows/sync-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 7b4c3c6..3a5c1ba 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -8,8 +8,7 @@ on: workflow_call: workflow_dispatch: schedule: - # 09:00 EEST/EET ≈ 06:00 UTC - - cron: '0 6 * * MON' + - cron: '0 6 * * MON' # 09:00 Romania time permissions: contents: write @@ -43,6 +42,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: + base: main commit-message: "Auto-sync documentation from latest content of bemanproject/beman" branch: auto/sync-docs title: "Weekly docs sync" From 431053073e6c8377a40f7cc59282fb67eba917cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 9 Dec 2025 02:23:04 +0200 Subject: [PATCH 04/44] Tweaks --- .github/workflows/sync-docs.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 3a5c1ba..6b622cf 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -8,7 +8,8 @@ on: workflow_call: workflow_dispatch: schedule: - - cron: '0 6 * * MON' # 09:00 Romania time + # 09:00 EEST/EET (Romania) ≈ 06:00 UTC + - cron: '0 6 * * MON' permissions: contents: write @@ -23,12 +24,14 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout beman repo uses: actions/checkout@v4 with: repository: bemanproject/beman path: beman + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 @@ -42,9 +45,10 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: + github_token: ${{ secrets.GITHUB_TOKEN }} base: main - commit-message: "Auto-sync documentation from latest content of bemanproject/beman" branch: auto/sync-docs + commit-message: "Auto-sync documentation from latest content of bemanproject/beman" title: "Weekly docs sync" body: | Automated sync of documentation and images from latest content of bemanproject/beman. From 2d55b53031a3b61f60abed38fd67eae11f23c39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 9 Dec 2025 02:24:13 +0200 Subject: [PATCH 05/44] Tweaks --- .github/workflows/sync-docs.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 6b622cf..3a5c1ba 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -8,8 +8,7 @@ on: workflow_call: workflow_dispatch: schedule: - # 09:00 EEST/EET (Romania) ≈ 06:00 UTC - - cron: '0 6 * * MON' + - cron: '0 6 * * MON' # 09:00 Romania time permissions: contents: write @@ -24,14 +23,12 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout beman repo uses: actions/checkout@v4 with: repository: bemanproject/beman path: beman - token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 @@ -45,10 +42,9 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: - github_token: ${{ secrets.GITHUB_TOKEN }} base: main - branch: auto/sync-docs commit-message: "Auto-sync documentation from latest content of bemanproject/beman" + branch: auto/sync-docs title: "Weekly docs sync" body: | Automated sync of documentation and images from latest content of bemanproject/beman. From 9f8201ace600f65a590ef2a158b045d3190e7d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:29:41 +0200 Subject: [PATCH 06/44] Test: Add PR testing support to sync-docs workflow --- .github/workflows/sync-docs.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 3a5c1ba..5e79c6d 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -39,7 +39,17 @@ jobs: run: | python3 scripts/sync-docs.py beman + - name: Show changes (for PR testing) + if: github.event_name == 'pull_request' + run: | + echo "=== Changes detected ===" + git status + echo "" + echo "=== Diff ===" + git diff || echo "No changes detected" + - name: Create Pull Request + if: github.event_name != 'pull_request' uses: peter-evans/create-pull-request@v6 with: base: main From a9c42502d062cacbf06adfad5537341755d5e1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:38:44 +0200 Subject: [PATCH 07/44] Add test mode for PR creation in sync-docs workflow --- .github/workflows/sync-docs.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 5e79c6d..ae9dda9 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -67,3 +67,20 @@ jobs: neatudarius RaduNichita mguludag + + - name: Create Pull Request (test mode on PR) + if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' + uses: peter-evans/create-pull-request@v6 + with: + base: main + commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" + branch: auto/sync-docs-test + title: "Test: Weekly docs sync" + body: | + **TEST MODE** - Automated sync of documentation and images from latest content of bemanproject/beman. + This PR was created for testing purposes. + labels: | + sync + automation + test + author: "github-actions[bot] " From 05d5b684897b62a10d0776ed2d6a0621f801ea21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:40:01 +0200 Subject: [PATCH 08/44] Use unique branch name format: website-weekly-docs-import-yyyy-mm-dd --- .github/workflows/sync-docs.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index ae9dda9..77baae8 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -39,6 +39,13 @@ jobs: run: | python3 scripts/sync-docs.py beman + - 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 (for PR testing) if: github.event_name == 'pull_request' run: | @@ -54,7 +61,7 @@ jobs: with: base: main commit-message: "Auto-sync documentation from latest content of bemanproject/beman" - branch: auto/sync-docs + branch: ${{ steps.branch-name.outputs.branch_name }} title: "Weekly docs sync" body: | Automated sync of documentation and images from latest content of bemanproject/beman. @@ -74,7 +81,7 @@ jobs: with: base: main commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" - branch: auto/sync-docs-test + branch: ${{ steps.branch-name.outputs.branch_name }} title: "Test: Weekly docs sync" body: | **TEST MODE** - Automated sync of documentation and images from latest content of bemanproject/beman. From 3c0411a98bf13ffc817ebacb705fa334128905b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:42:32 +0200 Subject: [PATCH 09/44] Fix: Clean up beman directory and handle PR permission limitations --- .github/workflows/sync-docs.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 77baae8..60fb4fd 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -39,6 +39,10 @@ jobs: run: | python3 scripts/sync-docs.py beman + - name: Clean up beman directory + run: | + rm -rf beman + - name: Generate branch name id: branch-name run: | @@ -75,10 +79,18 @@ jobs: RaduNichita mguludag + + - name: Note about PR limitations + if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' + run: | + echo "⚠️ Note: GitHub restricts GITHUB_TOKEN permissions when running on PRs for security reasons." + echo "To fully test PR creation, use 'workflow_dispatch' trigger or run on 'push' event." - name: Create Pull Request (test mode on PR) if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' + continue-on-error: true uses: peter-evans/create-pull-request@v6 with: + token: ${{ secrets.GITHUB_TOKEN }} base: main commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" branch: ${{ steps.branch-name.outputs.branch_name }} @@ -91,3 +103,4 @@ jobs: automation test author: "github-actions[bot] " + delete-branch: true \ No newline at end of file From 8b2cff99de94096da3f007cd428defabb278e864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:44:53 +0200 Subject: [PATCH 10/44] Add workflow_dispatch input for test mode --- .github/workflows/sync-docs.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 60fb4fd..4d74ffa 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -7,6 +7,12 @@ on: pull_request: workflow_call: workflow_dispatch: + inputs: + test_mode: + description: 'Run in test mode (adds test label)' + required: false + default: false + type: boolean schedule: - cron: '0 6 * * MON' # 09:00 Romania time @@ -60,7 +66,7 @@ jobs: git diff || echo "No changes detected" - name: Create Pull Request - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true') uses: peter-evans/create-pull-request@v6 with: base: main @@ -79,6 +85,24 @@ jobs: RaduNichita mguludag + - name: Create Pull Request (test mode via workflow_dispatch) + if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true' + uses: peter-evans/create-pull-request@v6 + with: + base: main + commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" + branch: ${{ steps.branch-name.outputs.branch_name }} + title: "Test: Weekly docs sync" + body: | + **TEST MODE** - Automated sync of documentation and images from latest content of bemanproject/beman. + This PR was created for testing purposes via workflow_dispatch. + labels: | + sync + automation + test + author: "github-actions[bot] " + delete-branch: true + - name: Note about PR limitations if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' From ac9553a716a14520139a7a47d63155b8dd0387ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:45:52 +0200 Subject: [PATCH 11/44] Add debug info and repository settings check for workflow_dispatch --- .github/workflows/sync-docs.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 4d74ffa..a48bdeb 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -56,6 +56,16 @@ jobs: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT echo "Generated branch name: $BRANCH_NAME" + - name: Debug workflow context + run: | + echo "Event name: ${{ github.event_name }}" + echo "Ref: ${{ github.ref }}" + echo "Head ref: ${{ github.head_ref }}" + echo "Base ref: ${{ github.base_ref }}" + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + echo "Test mode: ${{ github.event.inputs.test_mode }}" + fi + - name: Show changes (for PR testing) if: github.event_name == 'pull_request' run: | @@ -85,6 +95,18 @@ jobs: RaduNichita mguludag + - name: Check repository settings + if: github.event_name == 'workflow_dispatch' + run: | + echo "ℹ️ If you get permission errors, check repository settings:" + echo " 1. Go to Settings > Actions > General" + echo " 2. Under 'Workflow permissions', ensure 'Read and write permissions' is selected" + echo " 3. Check 'Allow GitHub Actions to create and approve pull requests'" + echo "" + echo "Current workflow permissions:" + echo " contents: write = ${{ github.event_name != 'pull_request' }}" + echo " pull-requests: write = ${{ github.event_name != 'pull_request' }}" + - name: Create Pull Request (test mode via workflow_dispatch) if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true' uses: peter-evans/create-pull-request@v6 From eacee6141e0a99c35737bd44e521b14cf00b23b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:49:36 +0200 Subject: [PATCH 12/44] Add support for Personal Access Token (PAT) to fix permission issues --- .github/workflows/sync-docs.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index a48bdeb..2158a14 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -79,6 +79,7 @@ jobs: if: github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true') 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 }} @@ -95,22 +96,33 @@ jobs: RaduNichita mguludag - - name: Check repository settings - if: github.event_name == 'workflow_dispatch' + - name: Check repository settings and PAT + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow') run: | - echo "ℹ️ If you get permission errors, check repository settings:" + echo "ℹ️ Repository settings check:" echo " 1. Go to Settings > Actions > General" echo " 2. Under 'Workflow permissions', ensure 'Read and write permissions' is selected" echo " 3. Check 'Allow GitHub Actions to create and approve pull requests'" echo "" + if [ -z "${{ secrets.GH_PAT }}" ]; then + echo "⚠️ No GH_PAT secret found. To fix permission errors when running on PRs:" + echo " 1. Create a Personal Access Token (PAT) with 'repo' scope" + echo " 2. Go to Settings > Secrets and variables > Actions" + echo " 3. Add a new secret named 'GH_PAT' with your PAT value" + echo " 4. Workflow will use PAT instead of GITHUB_TOKEN when available" + else + echo "✅ GH_PAT secret found - will use it for authentication" + fi + echo "" echo "Current workflow permissions:" - echo " contents: write = ${{ github.event_name != 'pull_request' }}" - echo " pull-requests: write = ${{ github.event_name != 'pull_request' }}" + echo " Event: ${{ github.event_name }}" + echo " Using token: ${{ secrets.GH_PAT && 'GH_PAT' || 'GITHUB_TOKEN' }}" - name: Create Pull Request (test mode via workflow_dispatch) if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true' uses: peter-evans/create-pull-request@v6 with: + token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} base: main commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" branch: ${{ steps.branch-name.outputs.branch_name }} @@ -136,7 +148,7 @@ jobs: continue-on-error: true uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} base: main commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" branch: ${{ steps.branch-name.outputs.branch_name }} From 9f023359d14156527e119f2c38f05f9c45eef653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:51:14 +0200 Subject: [PATCH 13/44] Improve PAT detection and instructions --- .github/workflows/sync-docs.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 2158a14..78d0b74 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -104,19 +104,17 @@ jobs: echo " 2. Under 'Workflow permissions', ensure 'Read and write permissions' is selected" echo " 3. Check 'Allow GitHub Actions to create and approve pull requests'" echo "" - if [ -z "${{ secrets.GH_PAT }}" ]; then - echo "⚠️ No GH_PAT secret found. To fix permission errors when running on PRs:" - echo " 1. Create a Personal Access Token (PAT) with 'repo' scope" - echo " 2. Go to Settings > Secrets and variables > Actions" - echo " 3. Add a new secret named 'GH_PAT' with your PAT value" - echo " 4. Workflow will use PAT instead of GITHUB_TOKEN when available" - else - echo "✅ GH_PAT secret found - will use it for authentication" - fi - echo "" echo "Current workflow permissions:" echo " Event: ${{ github.event_name }}" - echo " Using token: ${{ secrets.GH_PAT && 'GH_PAT' || 'GITHUB_TOKEN' }}" + echo "" + echo "⚠️ IMPORTANT: To fix permission errors when running on PRs, add GH_PAT secret:" + echo " 1. Create a Personal Access Token (PAT) with 'repo' scope:" + echo " https://github.com/settings/tokens/new?scopes=repo" + echo " 2. Go to repository Settings > Secrets and variables > Actions" + echo " 3. Add a new secret named 'GH_PAT' with your PAT value" + echo " 4. Workflow will automatically use PAT instead of GITHUB_TOKEN" + echo "" + echo " Note: Workflow uses GH_PAT if available, otherwise GITHUB_TOKEN" - name: Create Pull Request (test mode via workflow_dispatch) if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true' From b687a4f937394897901ce0a95a0858f8677a79db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:52:41 +0200 Subject: [PATCH 14/44] Add better PAT detection and error messages --- .github/workflows/sync-docs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 78d0b74..88c3f52 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -141,6 +141,14 @@ jobs: run: | echo "⚠️ Note: GitHub restricts GITHUB_TOKEN permissions when running on PRs for security reasons." echo "To fully test PR creation, use 'workflow_dispatch' trigger or run on 'push' event." + echo "" + if [ -n "${{ secrets.GH_PAT }}" ]; then + echo "✅ GH_PAT secret is configured - will use it for authentication" + else + echo "❌ GH_PAT secret NOT found - will use GITHUB_TOKEN (will fail with 403)" + echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" + fi + - name: Create Pull Request (test mode on PR) if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' continue-on-error: true From be3771478117b86568241b59fb33a0584af97d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:55:34 +0200 Subject: [PATCH 15/44] Clean up workflow: remove test/debug code, keep only production functionality --- .github/workflows/sync-docs.yml | 100 -------------------------------- 1 file changed, 100 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 88c3f52..c2bb5a9 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -4,15 +4,8 @@ on: push: branches: - main - pull_request: workflow_call: workflow_dispatch: - inputs: - test_mode: - description: 'Run in test mode (adds test label)' - required: false - default: false - type: boolean schedule: - cron: '0 6 * * MON' # 09:00 Romania time @@ -56,27 +49,7 @@ jobs: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT echo "Generated branch name: $BRANCH_NAME" - - name: Debug workflow context - run: | - echo "Event name: ${{ github.event_name }}" - echo "Ref: ${{ github.ref }}" - echo "Head ref: ${{ github.head_ref }}" - echo "Base ref: ${{ github.base_ref }}" - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "Test mode: ${{ github.event.inputs.test_mode }}" - fi - - - name: Show changes (for PR testing) - if: github.event_name == 'pull_request' - run: | - echo "=== Changes detected ===" - git status - echo "" - echo "=== Diff ===" - git diff || echo "No changes detected" - - name: Create Pull Request - if: github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true') uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} @@ -95,76 +68,3 @@ jobs: neatudarius RaduNichita mguludag - - - name: Check repository settings and PAT - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow') - run: | - echo "ℹ️ Repository settings check:" - echo " 1. Go to Settings > Actions > General" - echo " 2. Under 'Workflow permissions', ensure 'Read and write permissions' is selected" - echo " 3. Check 'Allow GitHub Actions to create and approve pull requests'" - echo "" - echo "Current workflow permissions:" - echo " Event: ${{ github.event_name }}" - echo "" - echo "⚠️ IMPORTANT: To fix permission errors when running on PRs, add GH_PAT secret:" - echo " 1. Create a Personal Access Token (PAT) with 'repo' scope:" - echo " https://github.com/settings/tokens/new?scopes=repo" - echo " 2. Go to repository Settings > Secrets and variables > Actions" - echo " 3. Add a new secret named 'GH_PAT' with your PAT value" - echo " 4. Workflow will automatically use PAT instead of GITHUB_TOKEN" - echo "" - echo " Note: Workflow uses GH_PAT if available, otherwise GITHUB_TOKEN" - - - name: Create Pull Request (test mode via workflow_dispatch) - if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true' - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} - base: main - commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" - branch: ${{ steps.branch-name.outputs.branch_name }} - title: "Test: Weekly docs sync" - body: | - **TEST MODE** - Automated sync of documentation and images from latest content of bemanproject/beman. - This PR was created for testing purposes via workflow_dispatch. - labels: | - sync - automation - test - author: "github-actions[bot] " - delete-branch: true - - - - name: Note about PR limitations - if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' - run: | - echo "⚠️ Note: GitHub restricts GITHUB_TOKEN permissions when running on PRs for security reasons." - echo "To fully test PR creation, use 'workflow_dispatch' trigger or run on 'push' event." - echo "" - if [ -n "${{ secrets.GH_PAT }}" ]; then - echo "✅ GH_PAT secret is configured - will use it for authentication" - else - echo "❌ GH_PAT secret NOT found - will use GITHUB_TOKEN (will fail with 403)" - echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" - fi - - - name: Create Pull Request (test mode on PR) - if: github.event_name == 'pull_request' && github.head_ref == 'test/sync-docs-workflow' - continue-on-error: true - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} - base: main - commit-message: "Test: Auto-sync documentation from latest content of bemanproject/beman" - branch: ${{ steps.branch-name.outputs.branch_name }} - title: "Test: Weekly docs sync" - body: | - **TEST MODE** - Automated sync of documentation and images from latest content of bemanproject/beman. - This PR was created for testing purposes. - labels: | - sync - automation - test - author: "github-actions[bot] " - delete-branch: true \ No newline at end of file From 4d8fd6778ed11e05dc18bfdac7b5ba8d44c31771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:55:50 +0200 Subject: [PATCH 16/44] Add back Show changes step with git status and git diff --- .github/workflows/sync-docs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index c2bb5a9..accecbb 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -49,6 +49,14 @@ jobs: 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: Create Pull Request uses: peter-evans/create-pull-request@v6 with: From 11bccda15e01e30d1bc0ba11e01bca2d7471ede7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:57:08 +0200 Subject: [PATCH 17/44] Add back pull_request trigger so workflow runs on PRs --- .github/workflows/sync-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index accecbb..5fe3657 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: workflow_call: workflow_dispatch: schedule: @@ -58,6 +59,7 @@ jobs: git diff || echo "No changes detected" - name: Create Pull Request + if: github.event_name != 'pull_request' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} From 50e26b5d26bdd84d95b7272a1e886f2f66d78b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 20:58:46 +0200 Subject: [PATCH 18/44] Allow PR creation on PRs when PAT is available --- .github/workflows/sync-docs.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 5fe3657..16c1386 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -58,8 +58,19 @@ jobs: 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' + if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} From 54f5d1299c5d38cf9eb06493f7a33dc1a507b081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:00:18 +0200 Subject: [PATCH 19/44] Add repository_dispatch trigger for on-demand API triggering --- .github/workflows/sync-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 16c1386..21f1f89 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -7,6 +7,9 @@ on: pull_request: workflow_call: workflow_dispatch: + repository_dispatch: + types: + - sync-docs schedule: - cron: '0 6 * * MON' # 09:00 Romania time From bc70e5e4d4a2deeaa67670455a85abfd2f6c3406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:02:50 +0200 Subject: [PATCH 20/44] Update .github/workflows/sync-docs.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 21f1f89..4b01ab7 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -11,7 +11,7 @@ on: types: - sync-docs schedule: - - cron: '0 6 * * MON' # 09:00 Romania time + - cron: '0 6 * * MON' # 08:00–09:00 Romania time (depending on DST) permissions: contents: write From cfc912dde278374dd9d75414a359fa070df85dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:03:00 +0200 Subject: [PATCH 21/44] Update .github/workflows/sync-docs.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/sync-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 4b01ab7..e8635bb 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -83,7 +83,6 @@ jobs: title: "Weekly docs sync" body: | Automated sync of documentation and images from latest content of bemanproject/beman. - Triggered by the weekly schedule. labels: | sync automation From f075c118ac00d68f1ddfbc8d18c1361ec667d929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:03:32 +0200 Subject: [PATCH 22/44] Update .github/workflows/sync-docs.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index e8635bb..ce8b0b6 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -73,7 +73,7 @@ jobs: fi - name: Create Pull Request - if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' + if: github.event_name != 'pull_request' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} From 9889e4f19069382520d4970b95e6f9e6e10ceee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:04:57 +0200 Subject: [PATCH 23/44] Add SPDX identifier --- .github/workflows/sync-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index ce8b0b6..fb9b036 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + name: Auto-sync Beman Docs on: From 4a29520f74e428c0b2a27f1126b36f921fdf8ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:06:59 +0200 Subject: [PATCH 24/44] Fail fatal if PAT is missing when running on PRs --- .github/workflows/sync-docs.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index fb9b036..70526db 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -63,7 +63,7 @@ jobs: echo "=== Diff ===" git diff || echo "No changes detected" - - name: Check if PAT is available + - name: Check if PAT is available for PR creation id: check-pat run: | if [ -n "${{ secrets.GH_PAT }}" ]; then @@ -71,11 +71,17 @@ jobs: 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)" + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "❌ FATAL: GH_PAT secret is required when running on pull_request events" + echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" + exit 1 + else + echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN" + fi fi - name: Create Pull Request - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} From b393851c487e1c52dc1f57a2449ef6671cf46a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:08:20 +0200 Subject: [PATCH 25/44] Add comprehensive debug section before Create Pull Request step --- .github/workflows/sync-docs.yml | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 70526db..7e87858 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -80,6 +80,46 @@ jobs: fi fi + - name: Debug workflow context and permissions + run: | + echo "=== Workflow Debug Information ===" + echo "" + echo "Event Information:" + echo " Event name: ${{ github.event_name }}" + echo " Ref: ${{ github.ref }}" + echo " Head ref: ${{ github.head_ref }}" + echo " Base ref: ${{ github.base_ref }}" + echo " SHA: ${{ github.sha }}" + echo "" + echo "Repository Information:" + echo " Repository: ${{ github.repository }}" + echo " Actor: ${{ github.actor }}" + echo " Workflow: ${{ github.workflow }}" + echo " Run ID: ${{ github.run_id }}" + echo " Run number: ${{ github.run_number }}" + echo "" + echo "Branch Information:" + echo " Generated branch: ${{ steps.branch-name.outputs.branch_name }}" + echo " Base branch: main" + echo "" + echo "Token Information:" + if [ -n "${{ secrets.GH_PAT }}" ]; then + echo " Token type: GH_PAT (Personal Access Token)" + echo " Token available: ✅ Yes" + else + echo " Token type: GITHUB_TOKEN" + echo " Token available: ⚠️ Limited permissions on PRs" + fi + echo "" + echo "Permissions:" + echo " Contents: write" + echo " Pull requests: write" + echo "" + echo "Git Status:" + git status --short || echo " (no changes or git error)" + echo "" + echo "=== End Debug Information ===" + - name: Create Pull Request if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' uses: peter-evans/create-pull-request@v6 From ee01cd92dcad31389662a8501ee647bef368873a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:12:54 +0200 Subject: [PATCH 26/44] Trigger workflow run From 97213722c8f3b823e8666b0b678e60b26d6c515c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:14:27 +0200 Subject: [PATCH 27/44] Move debug section earlier in workflow (after branch name generation) --- .github/workflows/sync-docs.yml | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 7e87858..04896f6 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -55,31 +55,6 @@ jobs: 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 for PR creation - 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 - if [ "${{ github.event_name }}" == "pull_request" ]; then - echo "❌ FATAL: GH_PAT secret is required when running on pull_request events" - echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" - exit 1 - else - echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN" - fi - fi - - name: Debug workflow context and permissions run: | echo "=== Workflow Debug Information ===" @@ -120,6 +95,31 @@ jobs: echo "" echo "=== End Debug Information ===" + - name: Show changes + run: | + echo "=== Changes detected ===" + git status + echo "" + echo "=== Diff ===" + git diff || echo "No changes detected" + + - name: Check if PAT is available for PR creation + 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 + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "❌ FATAL: GH_PAT secret is required when running on pull_request events" + echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" + exit 1 + else + echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN" + fi + fi + - name: Create Pull Request if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' uses: peter-evans/create-pull-request@v6 From c019525bc8675a690f658d0f490ac2d646cac933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:15:28 +0200 Subject: [PATCH 28/44] Move Show changes step right after Generate branch name --- .github/workflows/sync-docs.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 04896f6..a9fdef2 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -55,6 +55,14 @@ jobs: 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: Debug workflow context and permissions run: | echo "=== Workflow Debug Information ===" @@ -95,14 +103,6 @@ jobs: echo "" echo "=== End Debug Information ===" - - name: Show changes - run: | - echo "=== Changes detected ===" - git status - echo "" - echo "=== Diff ===" - git diff || echo "No changes detected" - - name: Check if PAT is available for PR creation id: check-pat run: | From 03acadea4f457b9ad5ed8c6d4431f3a660fe2312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:18:41 +0200 Subject: [PATCH 29/44] Trigger workflow run to test GH_PAT From 48033e2060e93a6f1f1e529fe274a778f47d1b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:20:33 +0200 Subject: [PATCH 30/44] Re-test workflow with GH_PAT secret From adbaa043c03ed8ebb346ed29e401f86d909cf0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:22:45 +0200 Subject: [PATCH 31/44] Trigger workflow run again From 9bb9c568d447d3ab1d4b0d8748d99091e1aefaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:26:24 +0200 Subject: [PATCH 32/44] Trigger workflow run From ee0dc4c8a44ea616234d3265d110c918223ca6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:30:42 +0200 Subject: [PATCH 33/44] Update PR title to include date and review request --- .github/workflows/sync-docs.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index a9fdef2..50260df 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -51,8 +51,10 @@ jobs: - name: Generate branch name id: branch-name run: | - BRANCH_NAME="website-weekly-docs-import-$(date +%Y-%m-%d)" + DATE_STR=$(date +%Y-%m-%d) + BRANCH_NAME="website-weekly-docs-import-$DATE_STR" echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT + echo "date_str=$DATE_STR" >> $GITHUB_OUTPUT echo "Generated branch name: $BRANCH_NAME" - name: Show changes @@ -86,12 +88,16 @@ jobs: echo " Base branch: main" echo "" echo "Token Information:" - if [ -n "${{ secrets.GH_PAT }}" ]; then + GH_PAT_VALUE="${{ secrets.GH_PAT }}" + if [ -n "$GH_PAT_VALUE" ] && [ "$GH_PAT_VALUE" != "" ]; then echo " Token type: GH_PAT (Personal Access Token)" echo " Token available: ✅ Yes" + echo " Token length: ${#GH_PAT_VALUE} characters" else echo " Token type: GITHUB_TOKEN" echo " Token available: ⚠️ Limited permissions on PRs" + echo " GH_PAT secret: ❌ Not found or empty" + echo " Note: Add GH_PAT secret at: Settings > Secrets and variables > Actions" fi echo "" echo "Permissions:" @@ -106,14 +112,17 @@ jobs: - name: Check if PAT is available for PR creation id: check-pat run: | - if [ -n "${{ secrets.GH_PAT }}" ]; then + GH_PAT_VALUE="${{ secrets.GH_PAT }}" + if [ -n "$GH_PAT_VALUE" ] && [ "$GH_PAT_VALUE" != "" ]; then echo "pat_available=true" >> $GITHUB_OUTPUT echo "✅ GH_PAT secret is available - will use it for PR creation" + echo " Token length: ${#GH_PAT_VALUE} characters" else echo "pat_available=false" >> $GITHUB_OUTPUT if [ "${{ github.event_name }}" == "pull_request" ]; then echo "❌ FATAL: GH_PAT secret is required when running on pull_request events" echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" + echo " Current value: [empty or not set]" exit 1 else echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN" @@ -128,7 +137,7 @@ jobs: base: main commit-message: "Auto-sync documentation from latest content of bemanproject/beman" branch: ${{ steps.branch-name.outputs.branch_name }} - title: "Weekly docs sync" + title: "Beman website weekly sync import (${{ steps.branch-name.outputs.date_str }}) - please review" body: | Automated sync of documentation and images from latest content of bemanproject/beman. labels: | From 72d7bf2cbe394b1e7d4ba6e2a443435cf7771a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:32:48 +0200 Subject: [PATCH 34/44] Update PR: set assignee to neatudarius, add reviewers, and link to issue #125 --- .github/workflows/sync-docs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 50260df..583ed9a 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -139,12 +139,16 @@ jobs: branch: ${{ steps.branch-name.outputs.branch_name }} title: "Beman website weekly sync import (${{ steps.branch-name.outputs.date_str }}) - please review" body: | - Automated sync of documentation and images from latest content of bemanproject/beman. + Automated sync of documentation and images from latest content of [bemanproject/beman](https://github.com/bemanproject/beman). + + Related to: #125 - Evergreen issue: automatic doc import labels: | sync automation author: "github-actions[bot] " assignees: | neatudarius + reviewers: | + neatudarius RaduNichita mguludag From 15442550494890a12c892407f237f3f9985f94ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:33:02 +0200 Subject: [PATCH 35/44] Fix issue reference text: 'automatic docs import' --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 583ed9a..739336a 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -141,7 +141,7 @@ jobs: body: | Automated sync of documentation and images from latest content of [bemanproject/beman](https://github.com/bemanproject/beman). - Related to: #125 - Evergreen issue: automatic doc import + Related to: #125 - Evergreen issue: automatic docs import labels: | sync automation From 906bee96322daa2faf088c4840df8e5eb7bd2e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:34:25 +0200 Subject: [PATCH 36/44] Change 'Evergreen' to 'evergreen' (lowercase) --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 739336a..50c75fb 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -141,7 +141,7 @@ jobs: body: | Automated sync of documentation and images from latest content of [bemanproject/beman](https://github.com/bemanproject/beman). - Related to: #125 - Evergreen issue: automatic docs import + Related to: #125 - evergreen issue: automatic docs import labels: | sync automation From ed9c751b5328a8a34c4f3f224a89e05091ef5e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:38:22 +0200 Subject: [PATCH 37/44] Simplify workflow: keep only schedule trigger, remove manual triggers and PR checks --- .github/workflows/sync-docs.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 50c75fb..0019d79 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -3,15 +3,6 @@ name: Auto-sync Beman Docs on: - push: - branches: - - main - pull_request: - workflow_call: - workflow_dispatch: - repository_dispatch: - types: - - sync-docs schedule: - cron: '0 6 * * MON' # 08:00–09:00 Romania time (depending on DST) @@ -109,28 +100,7 @@ jobs: echo "" echo "=== End Debug Information ===" - - name: Check if PAT is available for PR creation - id: check-pat - run: | - GH_PAT_VALUE="${{ secrets.GH_PAT }}" - if [ -n "$GH_PAT_VALUE" ] && [ "$GH_PAT_VALUE" != "" ]; then - echo "pat_available=true" >> $GITHUB_OUTPUT - echo "✅ GH_PAT secret is available - will use it for PR creation" - echo " Token length: ${#GH_PAT_VALUE} characters" - else - echo "pat_available=false" >> $GITHUB_OUTPUT - if [ "${{ github.event_name }}" == "pull_request" ]; then - echo "❌ FATAL: GH_PAT secret is required when running on pull_request events" - echo " Add GH_PAT secret at: Settings > Secrets and variables > Actions" - echo " Current value: [empty or not set]" - exit 1 - else - echo "⚠️ GH_PAT secret not found - using GITHUB_TOKEN" - fi - fi - - name: Create Pull Request - if: github.event_name != 'pull_request' || steps.check-pat.outputs.pat_available == 'true' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} From 692aef4eac7284a80daff49ecc41cc0530846132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:38:41 +0200 Subject: [PATCH 38/44] Add comprehensive documentation explaining workflow purpose, schedule, and behavior --- .github/workflows/sync-docs.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 0019d79..d177e02 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -1,5 +1,35 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# Auto-sync Beman Documentation Workflow +# +# Purpose: +# This workflow automatically synchronizes documentation and images from the +# bemanproject/beman repository to the website repository. It ensures that +# the website always has the latest documentation content without manual +# intervention. +# +# When it runs: +# - Weekly on Mondays at 6:00 AM UTC (08:00–09:00 Romania time, depending on DST) +# - Runs automatically via GitHub Actions schedule (cron) +# +# What it does: +# 1. Clones both the website and beman repositories +# 2. Runs the sync-docs.py script to copy documentation files and images +# 3. Cleans up temporary files (removes beman directory) +# 4. Creates a new branch with format: website-weekly-docs-import-YYYY-MM-DD +# 5. Creates a pull request with the synced changes +# +# Credentials: +# - Uses GITHUB_TOKEN (automatically provided by GitHub Actions) +# - The token has contents:write and pull-requests:write permissions +# +# Expected output: +# - A pull request titled: "Beman website weekly sync import (YYYY-MM-DD) - please review" +# - PR is assigned to neatudarius +# - PR has reviewers: neatudarius, RaduNichita, mguludag +# - PR is linked to issue #125 (evergreen issue: automatic docs import) +# - PR contains all synced documentation changes from bemanproject/beman + name: Auto-sync Beman Docs on: From e8494e62b2b9ded60e7b83a0f07686380c9ad52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:39:13 +0200 Subject: [PATCH 39/44] Optimize checkout: change fetch-depth from 0 to 1 for better performance --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index d177e02..12b12af 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -48,7 +48,7 @@ jobs: - name: Checkout website repo uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1 - name: Checkout beman repo uses: actions/checkout@v4 From 5fd264f0fc24f534df7a697735304982aa174203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:39:28 +0200 Subject: [PATCH 40/44] Remove unnecessary cleanup step - GitHub Actions runners auto-cleanup after jobs --- .github/workflows/sync-docs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 12b12af..35db93c 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -65,10 +65,6 @@ jobs: run: | python3 scripts/sync-docs.py beman - - name: Clean up beman directory - run: | - rm -rf beman - - name: Generate branch name id: branch-name run: | From 29d37852c4f69f1e424876fe593446c795af1a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:39:43 +0200 Subject: [PATCH 41/44] Make error message more generic: clarify repository Settings location --- .github/workflows/sync-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 35db93c..ed6daf5 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -114,7 +114,7 @@ jobs: echo " Token type: GITHUB_TOKEN" echo " Token available: ⚠️ Limited permissions on PRs" echo " GH_PAT secret: ❌ Not found or empty" - echo " Note: Add GH_PAT secret at: Settings > Secrets and variables > Actions" + echo " Note: Add GH_PAT secret in repository Settings under Secrets and variables > Actions" fi echo "" echo "Permissions:" From 7adddaac19ebb0235fb063b6f93139934a41dd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:40:46 +0200 Subject: [PATCH 42/44] Make assignees and reviewers configurable via repository variables with hardcoded defaults and explanatory comments --- .github/workflows/sync-docs.yml | 44 ++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index ed6daf5..0acf7d7 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -126,6 +126,42 @@ jobs: echo "" echo "=== End Debug Information ===" + - name: Prepare PR assignees and reviewers + id: pr-people + run: | + # Use repository variables if set, otherwise fall back to hardcoded defaults. + # These users are hardcoded as the primary website maintainers responsible + # for reviewing documentation sync PRs. If team membership changes, update + # repository variables DOC_SYNC_ASSIGNEES and DOC_SYNC_REVIEWERS instead of + # modifying this workflow file. + # Default assignee: neatudarius (primary website maintainer) + # Default reviewers: neatudarius, RaduNichita, mguludag (website maintainers) + # Get assignees and reviewers from vars or use defaults + if [ -n "${{ vars.DOC_SYNC_ASSIGNEES }}" ]; then + ASSIGNEES="${{ vars.DOC_SYNC_ASSIGNEES }}" + else + ASSIGNEES="neatudarius" + fi + + if [ -n "${{ vars.DOC_SYNC_REVIEWERS }}" ]; then + REVIEWERS="${{ vars.DOC_SYNC_REVIEWERS }}" + else + REVIEWERS="neatudarius + RaduNichita + mguludag" + fi + + echo "assignees<> $GITHUB_OUTPUT + echo "$ASSIGNEES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + echo "reviewers<> $GITHUB_OUTPUT + echo "$REVIEWERS" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + echo "Using assignees: $ASSIGNEES" + echo "Using reviewers: $REVIEWERS" + - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: @@ -142,9 +178,5 @@ jobs: sync automation author: "github-actions[bot] " - assignees: | - neatudarius - reviewers: | - neatudarius - RaduNichita - mguludag + assignees: ${{ steps.pr-people.outputs.assignees }} + reviewers: ${{ steps.pr-people.outputs.reviewers }} From 5d5952843c9e0842448b25a66a0f6334df895bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Mon, 19 Jan 2026 21:41:50 +0200 Subject: [PATCH 43/44] Add workflow_dispatch and repository_dispatch triggers for manual testing --- .github/workflows/sync-docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 0acf7d7..ea7aeb9 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -11,6 +11,8 @@ # When it runs: # - Weekly on Mondays at 6:00 AM UTC (08:00–09:00 Romania time, depending on DST) # - Runs automatically via GitHub Actions schedule (cron) +# - Can be triggered manually via workflow_dispatch (Actions tab → Run workflow) +# - Can be triggered via API using repository_dispatch with type "sync-docs" # # What it does: # 1. Clones both the website and beman repositories @@ -35,6 +37,10 @@ name: Auto-sync Beman Docs on: schedule: - cron: '0 6 * * MON' # 08:00–09:00 Romania time (depending on DST) + workflow_dispatch: # Manual trigger for testing + repository_dispatch: # API trigger for on-demand runs + types: + - sync-docs permissions: contents: write From 82cc677e0a3e72cd0065cdb74ae9cf487a5762c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Tue, 31 Mar 2026 01:18:10 +0300 Subject: [PATCH 44/44] gigel --- .github/workflows/sync-docs.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index ea7aeb9..70f422b 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -22,13 +22,17 @@ # 5. Creates a pull request with the synced changes # # Credentials: -# - Uses GITHUB_TOKEN (automatically provided by GitHub Actions) -# - The token has contents:write and pull-requests:write permissions +# - create-pull-request uses GITHUB_TOKEN only so the PR is opened by +# github-actions[bot]; reviewers can then include neatudarius even when the +# workflow is triggered by neatudarius (manual) or by schedule (GH rejects +# review requests from the PR author — using a personal PAT as token made +# the PAT owner the PR author). +# - Optional secrets.GH_PAT is not used for opening the PR (see Create Pull Request step). # # Expected output: # - A pull request titled: "Beman website weekly sync import (YYYY-MM-DD) - please review" # - PR is assigned to neatudarius -# - PR has reviewers: neatudarius, RaduNichita, mguludag +# - PR has reviewers: neatudarius, RaduNichita, mguludag (requires GITHUB_TOKEN for PR) # - PR is linked to issue #125 (evergreen issue: automatic docs import) # - PR contains all synced documentation changes from bemanproject/beman @@ -111,16 +115,12 @@ jobs: echo " Base branch: main" echo "" echo "Token Information:" + echo " Create Pull Request: GITHUB_TOKEN (PR author = github-actions[bot] → neatudarius can be reviewer)" GH_PAT_VALUE="${{ secrets.GH_PAT }}" if [ -n "$GH_PAT_VALUE" ] && [ "$GH_PAT_VALUE" != "" ]; then - echo " Token type: GH_PAT (Personal Access Token)" - echo " Token available: ✅ Yes" - echo " Token length: ${#GH_PAT_VALUE} characters" + echo " secrets.GH_PAT: set (not used for opening PR in this workflow)" else - echo " Token type: GITHUB_TOKEN" - echo " Token available: ⚠️ Limited permissions on PRs" - echo " GH_PAT secret: ❌ Not found or empty" - echo " Note: Add GH_PAT secret in repository Settings under Secrets and variables > Actions" + echo " secrets.GH_PAT: not set (optional)" fi echo "" echo "Permissions:" @@ -141,7 +141,9 @@ jobs: # repository variables DOC_SYNC_ASSIGNEES and DOC_SYNC_REVIEWERS instead of # modifying this workflow file. # Default assignee: neatudarius (primary website maintainer) - # Default reviewers: neatudarius, RaduNichita, mguludag (website maintainers) + # Default reviewers: include neatudarius only if Create Pull Request uses + # GITHUB_TOKEN (PR opened by bot). Do not use a personal PAT as that step's + # token or GitHub will reject neatudarius as reviewer when they are PR author. # Get assignees and reviewers from vars or use defaults if [ -n "${{ vars.DOC_SYNC_ASSIGNEES }}" ]; then ASSIGNEES="${{ vars.DOC_SYNC_ASSIGNEES }}" @@ -171,7 +173,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} base: main commit-message: "Auto-sync documentation from latest content of bemanproject/beman" branch: ${{ steps.branch-name.outputs.branch_name }}