mirror of
https://github.com/Z3Prover/z3
synced 2026-05-24 19:06:21 +00:00
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/35080496-0ba4-4fbc-a441-5f5c430e978c Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
name: Publish TPTP Test Report as Discussion
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
category:
|
|
description: 'Discussion category name'
|
|
required: false
|
|
default: 'Agentic Workflows'
|
|
type: string
|
|
|
|
permissions:
|
|
discussions: write
|
|
contents: read
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: copilot/test-copilot-integration
|
|
|
|
- name: Read report
|
|
id: report
|
|
run: |
|
|
BODY=$(cat tptp-test-report.md)
|
|
echo "body<<EOF_REPORT" >> "$GITHUB_OUTPUT"
|
|
echo "$BODY" >> "$GITHUB_OUTPUT"
|
|
echo "EOF_REPORT" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Create GitHub Discussion
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
// Get discussion category ID
|
|
const categoryName = '${{ inputs.category }}';
|
|
const repoId = context.payload.repository.node_id;
|
|
|
|
const catQuery = await github.graphql(`
|
|
query($owner: String!, $name: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
id
|
|
discussionCategories(first: 20) {
|
|
nodes { id name slug }
|
|
}
|
|
}
|
|
}
|
|
`, { owner: context.repo.owner, name: context.repo.repo });
|
|
|
|
const cats = catQuery.repository.discussionCategories.nodes;
|
|
console.log('Available categories:', cats.map(c => c.name));
|
|
|
|
let cat = cats.find(c => c.name === categoryName);
|
|
if (!cat) {
|
|
cat = cats.find(c => c.name.toLowerCase().includes('general')) || cats[0];
|
|
console.log(`Category "${categoryName}" not found, using: ${cat?.name}`);
|
|
}
|
|
|
|
if (!cat) {
|
|
core.setFailed('No discussion category found');
|
|
return;
|
|
}
|
|
|
|
const body = `${{ steps.report.outputs.body }}`;
|
|
const repoNodeId = catQuery.repository.id;
|
|
|
|
const result = await github.graphql(`
|
|
mutation($input: CreateDiscussionInput!) {
|
|
createDiscussion(input: $input) {
|
|
discussion { url title }
|
|
}
|
|
}
|
|
`, {
|
|
input: {
|
|
repositoryId: repoNodeId,
|
|
categoryId: cat.id,
|
|
title: 'TPTP Integration Test Report — copilot/integrate-tptp-into-src-shell',
|
|
body: body
|
|
}
|
|
});
|
|
|
|
const url = result.createDiscussion.discussion.url;
|
|
console.log('Discussion created:', url);
|
|
core.summary.addRaw(`## Discussion Created\n\n[${url}](${url})`);
|
|
await core.summary.write();
|