mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix: remove PR comment step from OpenAPI spec generation workflow
This commit is contained in:
36
.github/workflows/openapi-spec-generation.yml
vendored
36
.github/workflows/openapi-spec-generation.yml
vendored
@@ -71,38 +71,4 @@ jobs:
|
||||
with:
|
||||
name: openapi-spec
|
||||
path: ./openapi.json
|
||||
retention-days: 30
|
||||
|
||||
- name: Comment PR with spec info (on PR)
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const path = './openapi.json';
|
||||
|
||||
if (fs.existsSync(path)) {
|
||||
const spec = JSON.parse(fs.readFileSync(path, 'utf8'));
|
||||
const pathCount = Object.keys(spec.paths || {}).length;
|
||||
const version = spec.info?.version || 'Unknown';
|
||||
const title = spec.info?.title || 'Unknown';
|
||||
|
||||
const comment = `## 📋 OpenAPI Spec Generation Results
|
||||
|
||||
✅ **OpenAPI specification generated successfully!**
|
||||
|
||||
**Details:**
|
||||
- 📝 **Title:** ${title}
|
||||
- 🏷️ **Version:** ${version}
|
||||
- 🛣️ **API Paths:** ${pathCount}
|
||||
- 📄 **File Size:** ${(fs.statSync(path).size / 1024).toFixed(2)} KB
|
||||
|
||||
The generated OpenAPI specification is available as an artifact in this workflow run.`;
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
});
|
||||
}
|
||||
retention-days: 30
|
||||
Reference in New Issue
Block a user