File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Pull Request check"
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ pull-requests : write
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v3
18+ - name : Clone submodules
19+ run : |
20+ git submodule init
21+ git submodule update
22+ - name : Update and Install dependencies
23+ run : |
24+ sudo apt-get update
25+ sudo apt-get install -y cmake build-essential g++
26+ - name : Build
27+ id : build
28+ run : |
29+ mkdir build
30+ cd build
31+ cmake ..
32+ make
33+ - name : Post success comment
34+ if : ${{ success() }}
35+ uses : actions/github-script@v6
36+ with :
37+ script : |
38+ github.rest.issues.createComment({
39+ issue_number: context.issue.number,
40+ owner: context.repo.owner,
41+ repo: context.repo.repo,
42+ body: 'Build successful! 🎉'
43+ });
44+ - name : Post failure comment
45+ if : ${{ failure() }}
46+ uses : actions/github-script@v6
47+ with :
48+ script : |
49+ github.rest.issues.createComment({
50+ ...context.repo,
51+ issue_number: context.issue.number,
52+ owner: context.repo.owner,
53+ repo: context.repo.repo,
54+ body: `Build failed! ❌\n\n\`\`\`\n${{ steps.build.outputs.stderr || 'Unknown error' }}\n\`\`\``
55+ });
You can’t perform that action at this time.
0 commit comments