From d10b5b39a1a82e4d6711ee524a9c8755c80efb85 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Sat, 5 Sep 2026 12:57:57 +0300 Subject: [PATCH] Add weekly scheduled CI run and CODEOWNERS Runs the existing test suite weekly (Mondays 06:05 UTC) in addition to push/PR, and adds a CODEOWNERS file with the learning-fuel team as owner. On CI failure, files/updates a GitHub issue mentioning the team. Co-Authored-By: Claude Sonnet 5 --- .github/CODEOWNERS | 1 + .github/workflows/main.yaml | 44 ++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8eac885 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @mongodb-developer/learning-fuel diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a803944..47c3903 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,6 +6,8 @@ on: pull_request: branches: [ main ] workflow_dispatch: + schedule: + - cron: '5 6 * * 1' jobs: build: @@ -68,4 +70,44 @@ jobs: working-directory: mern/client start: npm run dev wait-on: 'http://localhost:5173' - + + notify-on-failure: + needs: build + if: failure() + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: File or update CI failure issue for @mongodb-developer/learning-fuel + uses: actions/github-script@v7 + with: + script: | + const title = `CI failure on ${context.ref}`; + const body = [ + '@mongodb-developer/learning-fuel the CI workflow failed.', + '', + `Workflow: ${context.workflow}`, + `Run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + ].join('\n'); + const { data: existing } = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + labels: 'ci-failure', + }); + if (existing.length > 0) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: existing[0].number, + body, + }); + } else { + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title, + body, + labels: ['ci-failure'], + }); + }