Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @mongodb-developer/learning-fuel
44 changes: 43 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: '5 6 * * 1'

jobs:
build:
Expand Down Expand Up @@ -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'],
});
}
Loading