Skip to content

Commit 8f465dd

Browse files
committed
add update low priority workflow
1 parent e86d856 commit 8f465dd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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);

0 commit comments

Comments
 (0)