File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : update low priority items based on ADO query
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ jobs :
7
+ update-low-priority-items :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/setup-node@v3
11
+ with :
12
+ node-version : ' 20.x'
13
+ - run : npm install azure-devops-node-api
14
+ - uses : actions/github-script@v7
15
+ env :
16
+ ado_token : ' ${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}'
17
+ query_id : ' ${{ secrets.ADO_QUERY_ID }}'
18
+ with :
19
+ script : |
20
+ const azdev = require('azure-devops-node-api')
21
+
22
+ try {
23
+ const orgUrl = "https://dev.azure.com/microsoft";
24
+ const adoAuthHandler = azdev.getPersonalAccessTokenHandler(process.env.ado_token);
25
+ const adoConnection = new azdev.WebApi(orgUrl, adoAuthHandler);
26
+ adoClient = await adoConnection.getWorkItemTrackingApi();
27
+ } catch (e) {
28
+ console.error(e);
29
+ core.setFailed('Could not connect to ADO');
30
+ return;
31
+ }
32
+
33
+ const queryResult = await adoClient.queryById(process.env.query_id);
34
+ console.log(queryResult);
You can’t perform that action at this time.
0 commit comments