File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Knowledge Base Article
2+ on :
3+ repository_dispatch :
4+ types : [publish-kb]
5+
6+ run-name : Publish Knowledge Base Article ${{ github.event.client_payload.name }} ${{ github.event.client_payload.id }}
7+
8+ permissions :
9+ contents : write
10+ pull-requests : write
11+
12+ concurrency :
13+ group : ' ${{ github.workflow }} ${{ github.event.client_payload.id }}'
14+ cancel-in-progress : true
15+
16+ jobs :
17+ publish_kb :
18+ runs-on : windows-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v3
22+
23+ - name : configure git
24+ run : |
25+ git config --global user.email "[email protected] " 26+ git config --global user.name "KB Bot"
27+ - name : Create branch
28+ run : |
29+ git checkout -b "new-kb-$($env:name)-$($env:id)"
30+ cd $env:folder
31+ echo $env:content > "$($env:name).md"
32+ git add "$($env:name).md"
33+ git commit -m "Added new kb article $($env:name)"
34+ git push -u origin "new-kb-$($env:name)-$($env:id)"
35+ env :
36+ name : ${{ github.event.client_payload.name }}
37+ content : ${{ github.event.client_payload.content }}
38+ folder : ${{ github.event.client_payload.folder }}
39+ id : ${{ github.event.client_payload.id }}
40+
41+ - name : Create pull request
42+ run : gh pr create --fill
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments