File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,30 @@ Screenshot of validating the logs and creating pull requests:
12
12
13
13
<img width =" 713 " alt =" image " src =" https://user-images.githubusercontent.com/19912012/182616583-70ef5ac4-c669-40df-8fa4-60b15ab1f58f.png " >
14
14
15
+ ## Usage
16
+
17
+ ``` yml
18
+ on :
19
+ pull_request :
20
+ branches : [ "main" ]
21
+
22
+ jobs :
23
+ pr-commit-message-enforcer-and-linker :
24
+ runs-on : ubuntu-latest
25
+
26
+ steps :
27
+ - name : Azure DevOps Commit Validator and Pull Request Linker
28
+ uses : joshjohanning/azdo_commit_message_validator@v1
29
+ with :
30
+ azure-devops-organization : myorg # The name of the Azure DevOps organization
31
+ azure-devops-token : ${{ secrets.AZURE_DEVOPS_PAT }} # "Azure DevOps Personal Access Token (needs to be a full PAT)
32
+ fail-if-missing-workitem-commit-link : true # Fail the action if a commit in the pull request is missing AB# in the commit message
33
+ ` ` `
34
+
15
35
## Setup
16
36
17
37
1. Create a repository secret titled ` AZURE_DEVOPS_PAT`
18
- 2 . Update the org name in the ` action.yml ` file under ` env `
38
+ 2. Pass the Azure DevOps organization to the `azure-devops-organization` input parameter
19
39
20
40
# # How this works
21
41
Original file line number Diff line number Diff line change 9
9
azure-devops-organization :
10
10
description : " The name of the Azure DevOps organization"
11
11
required : true
12
+ github-token :
13
+ description : " The GitHub token that has pull request access"
14
+ required : true
15
+ default : ${{ github.token }}
16
+ azure-devops-token :
17
+ description : " Azure DevOps Personal Access Token (needs to be a full PAT)"
18
+ required : true
12
19
fail-if-missing-workitem-commit-link :
13
20
description : " Fail the action if a commit in the pull request is missing AB# in the commit message"
14
21
required : true
42
49
echo "Workitem = $WORKITEM"
43
50
44
51
# make the call to main.js to do the linking
45
- REPO_TOKEN=${{ github. token }} AZURE_DEVOPS_ORG=${{ env.azure_devops_org }} AZURE_DEVOPS_PAT=${{ secrets.AZURE_DEVOPS_PAT }} WORKITEMID=$WORKITEM PULLREQUESTID=${{ github.event.number }} REPO=${{ github.repository }} node main.js
52
+ REPO_TOKEN=${{ inputs.github- token }} AZURE_DEVOPS_ORG=${{ inputs.azure-devops-organization }} AZURE_DEVOPS_PAT=${{ inputs.azure-devops-token }} WORKITEMID=$WORKITEM PULLREQUESTID=${{ github.event.number }} REPO=${{ github.repository }} node main.js
46
53
fi
47
54
done
You can’t perform that action at this time.
0 commit comments