diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5526e0e..c6050d3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,8 +33,8 @@ jobs: - name: Set branch name id: vars run: | - ref=${{ github.event.pull_request.head.ref }} - if [ "$ref" == "refs/heads/main" ]; then + ref="${{ github.event.pull_request.head.ref || github.ref_name }}" + if [ "$ref" = "refs/heads/main" ] || [ "$ref" = "main" ]; then echo "branch=main" >> $GITHUB_OUTPUT else echo "branch=${ref}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/generate-actions-list.yml b/.github/workflows/generate-actions-list.yml index d2c03fa..d4c253a 100644 --- a/.github/workflows/generate-actions-list.yml +++ b/.github/workflows/generate-actions-list.yml @@ -6,9 +6,12 @@ concurrency: on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # Run at midnight UTC every Sunday permissions: contents: write + actions: write jobs: generate-packages: @@ -34,7 +37,7 @@ jobs: - name: Generate packages list env: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - run: node scripts/generate_actions.mjs + run: bun scripts/generate_actions.mjs - name: Check for changes id: git-check run: | @@ -45,6 +48,8 @@ jobs: fi - name: Commit and push generated files if: steps.git-check.outputs.changes == 'true' + env: + GH_TOKEN: ${{ github.token }} run: | git config --local user.name "github-actions[bot]" git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -53,7 +58,7 @@ jobs: git add .gitattributes 2>/dev/null || true git add loadedVectorStore/*.json loadedVectorStore/*.index 2>/dev/null || true git add -A - git commit -m "chore: update NPM packages list [skip ci]" \ + git commit -m "chore: update NPM packages list" \ -m "Automated update from generate-actions workflow" \ -m "Run ID: ${{ github.run_id }}" # Try to pull and rebase in case of conflicts @@ -64,6 +69,7 @@ jobs: exit 1 } git push origin main + gh workflow run deploy.yml --ref main - name: Report no changes if: steps.git-check.outputs.changes != 'true' run: echo "✅ No changes to commit - packages list is up to date" \ No newline at end of file diff --git a/.github/workflows/train-model.yml b/.github/workflows/train-model.yml index 7a91cd5..990454f 100644 --- a/.github/workflows/train-model.yml +++ b/.github/workflows/train-model.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + actions: write jobs: deploy: @@ -47,6 +48,8 @@ jobs: - name: Commit generated files if: steps.git-check.outputs.changes == 'true' + env: + GH_TOKEN: ${{ github.token }} run: | git config --local user.name "github-actions[bot]" git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -55,7 +58,7 @@ jobs: git add .gitattributes 2>/dev/null || true git add loadedVectorStore/*.json loadedVectorStore/*.index 2>/dev/null || true git add -A - git commit -m "chore: update trained model [skip ci]" \ + git commit -m "chore: update trained model" \ -m "Automated update from train-model workflow" \ -m "Run ID: ${{ github.run_id }}" git pull --rebase origin main || { @@ -65,6 +68,7 @@ jobs: exit 1 } git push origin main + gh workflow run deploy.yml --ref main working-directory: ./ - name: Report no changes diff --git a/.github/workflows/write-readmes.yml b/.github/workflows/write-readmes.yml index 1fdbae2..aab1cf2 100644 --- a/.github/workflows/write-readmes.yml +++ b/.github/workflows/write-readmes.yml @@ -6,9 +6,12 @@ concurrency: on: workflow_dispatch: + schedule: + - cron: '0 1 * * 0' # Run at 1AM UTC every Sunday permissions: contents: write + actions: write jobs: fetch-and-create: @@ -32,7 +35,7 @@ jobs: - name: Install dependencies run: bun install - name: Create READMEs - run: node scripts/write_readme.mjs + run: bun scripts/write_readme.mjs env: BEARER_TOKEN: ${{ secrets.BEARER_TOKEN }} - name: Check for changes @@ -45,6 +48,8 @@ jobs: fi - name: Commit and push generated files if: steps.git-check.outputs.changes == 'true' + env: + GH_TOKEN: ${{ github.token }} run: | git config --local user.name "github-actions[bot]" git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -55,7 +60,7 @@ jobs: git add loadedVectorStore/*.json loadedVectorStore/*.index 2>/dev/null || true git add -A - git commit -m "chore: update READMEs from NPM packages [skip ci]" \ + git commit -m "chore: update READMEs from NPM packages" \ -m "Automated update from write-readmes workflow" \ -m "Run ID: ${{ github.run_id }}" @@ -68,6 +73,7 @@ jobs: } git push origin main + gh workflow run deploy.yml --ref main - name: Report no changes if: steps.git-check.outputs.changes != 'true' diff --git a/.github/workflows/write-tutorials.yml b/.github/workflows/write-tutorials.yml index e30cb22..8a64b23 100644 --- a/.github/workflows/write-tutorials.yml +++ b/.github/workflows/write-tutorials.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + actions: write jobs: deploy: @@ -47,6 +48,8 @@ jobs: - name: Commit generated files if: steps.git-check.outputs.changes == 'true' + env: + GH_TOKEN: ${{ github.token }} run: | git config --local user.name "github-actions[bot]" git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -55,7 +58,7 @@ jobs: git add .gitattributes 2>/dev/null || true git add loadedVectorStore/*.json loadedVectorStore/*.index 2>/dev/null || true git add -A - git commit -m "chore: update generated tutorials [skip ci]" \ + git commit -m "chore: update generated tutorials" \ -m "Automated update from write-tutorials workflow" \ -m "Run ID: ${{ github.run_id }}" git pull --rebase origin main || { @@ -65,6 +68,7 @@ jobs: exit 1 } git push origin main + gh workflow run deploy.yml --ref main working-directory: ./ - name: Report no changes