Skip to content
Closed
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
62 changes: 61 additions & 1 deletion .github/workflows/ci_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install mystmd
run: npm install mystmd

- name: Setup Python
uses: actions/setup-python@v6
with:
Expand All @@ -45,6 +53,58 @@ jobs:
publish_dir: ./_build/html/
commit_message: ${{ github.event.head_commit.message }}

- name: Create issue or comment if run fails
if: failure()
uses: actions/github-script@v7
with:
script: |
const title = `❌ Job failed: ${context.job} Run #${context.runNumber}`;

// Search for existing open issue with the same title
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'workflow-failure',
per_page: 100
});

const existingIssue = issues.data.find(issue => issue.title === title);

const body = `## Job Failed

**Job:** ${context.job}
**Workflow:** ${context.workflow}
**Event:** ${context.eventName}
**Run ID:** ${context.runId}
**Run Number:** ${context.runNumber}
**Run Attempt:** ${context.runAttempt}
**Ref:** ${context.ref}
**Ref Name:** ${context.refName}
**SHA:** ${context.sha}
**Short SHA:** ${context.sha.substring(0, 7)}

[View run details](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`;

if (existingIssue) {
// Add comment to existing issue (for retry attempts)
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existingIssue.number,
body: body
});
} else {
// Create new issue
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
labels: ['workflow-failure']
});
}

deploy_notebooks:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
name: Deploy deployed_notebook branch
Expand All @@ -62,4 +122,4 @@ jobs:
git rm --cached -r .
git add --pathspec-from-file=deployed_notebooks_manifest.in --force
git commit -m "Deploy notebooks for commit ${gith}"
git push origin deployed_notebooks --force
git push origin deployed_notebooks --force
8 changes: 8 additions & 0 deletions .github/workflows/ci_tests_run_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install mystmd
run: npm install mystmd

- name: Setup Python
uses: actions/setup-python@v6
with:
Expand Down