File tree Expand file tree Collapse file tree 1 file changed +2
-25
lines changed
Expand file tree Collapse file tree 1 file changed +2
-25
lines changed Original file line number Diff line number Diff line change 11name : CI/CD Pipeline
22
33on :
4- push :
5- branches : [ main, develop ]
6- pull_request :
7- branches : [ main ]
84 workflow_dispatch :
95 inputs :
106 tutorial_url :
4238 validate-tutorial :
4339 needs : build-and-test
4440 runs-on : ubuntu-latest
45- if : github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
41+ environment : protected-validation
4642
4743 steps :
4844 - name : Checkout code
8076 with :
8177 name : validation-results
8278 path : output/
83-
84- - name : Comment PR with results
85- if : github.event_name == 'pull_request'
86- uses : actions/github-script@v7
87- with :
88- script : |
89- const fs = require('fs');
90- const path = './output/summary.json';
91-
92- if (fs.existsSync(path)) {
93- const summary = JSON.parse(fs.readFileSync(path, 'utf8'));
94- const status = summary.OverallStatus === 'Passed' ? '✅' : '❌';
95-
96- github.rest.issues.createComment({
97- issue_number: context.issue.number,
98- owner: context.repo.owner,
99- repo: context.repo.repo,
100- body: `## Tutorial Validation Results ${status}\n\n**Tutorial:** ${summary.TutorialName}\n**Status:** ${summary.OverallStatus}\n**Duration:** ${summary.Duration}\n\nSee artifacts for detailed results.`
101- });
102- }
79+
You can’t perform that action at this time.
0 commit comments