Skip to content

Commit 1b7c779

Browse files
committed
ci: auto-create issue on scheduled Stan check failure
1 parent ba2d3ee commit 1b7c779

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/check-cmdstan.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,38 @@ jobs:
103103
all(message == "Stan program is syntactically correct")
104104
)
105105
shell: Rscript {0}
106+
107+
- name: Create issue on failure
108+
if: failure() && github.event_name == 'schedule'
109+
uses: actions/github-script@v7
110+
with:
111+
script: |
112+
const title = 'Stan syntax check failed on scheduled run';
113+
const { data: issues } = await github.rest.issues.listForRepo({
114+
owner: context.repo.owner,
115+
repo: context.repo.repo,
116+
state: 'open',
117+
labels: 'stan-check-failure'
118+
});
119+
if (issues.length === 0) {
120+
await github.rest.issues.create({
121+
owner: context.repo.owner,
122+
repo: context.repo.repo,
123+
title: title,
124+
body: [
125+
'The weekly `check-cmdstan` workflow failed.',
126+
'',
127+
'This likely means an upstream dependency ' +
128+
'(e.g. primarycensored) changed its Stan ' +
129+
'function signatures.',
130+
'',
131+
`Run: ${context.serverUrl}/${context.repo.owner}` +
132+
`/${context.repo.repo}/actions/runs` +
133+
`/${context.runId}`,
134+
'',
135+
'This was opened by a bot. Please ping ' +
136+
'@seabbs for any questions.'
137+
].join('\n'),
138+
labels: ['stan-check-failure']
139+
});
140+
}

0 commit comments

Comments
 (0)