File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Create Azure DevOps CI on PR
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+
7+ jobs :
8+ create-work-item :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Create Azure DevOps Task
12+ env :
13+ ADO_ORG_URL : https://dev.azure.com/KMOps
14+ ADO_PROJECT : ContentExperience
15+ ADO_PAT : ${{ secrets.ADO_PAT }}
16+ run : |
17+ PR_TITLE="${{ github.event.pull_request.title }}"
18+ PR_BODY="${{ github.event.pull_request.body }}"
19+ PR_URL="${{ github.event.pull_request.html_url }}"
20+
21+ curl -X POST \
22+ -H "Content-Type: application/json-patch+json" \
23+ -H "Authorization: Basic $(echo -n ":$ADO_PAT" | base64)" \
24+ $ADO_ORG_URL/$ADO_PROJECT/_apis/wit/workitems/$ExternalCI?api-version=6.0 \
25+ -d '[
26+ {
27+ "op": "add",
28+ "path": "/fields/System.Title",
29+ "value": "PR Opened: '"$PR_TITLE"'"
30+ },
31+ {
32+ "op": "add",
33+ "path": "/fields/System.Description",
34+ "value": "Pull Request URL: '"$PR_URL"'\n\n'"$PR_BODY"'"
35+ }
36+ ]'
You can’t perform that action at this time.
0 commit comments