Skip to content

Commit

Permalink
add update low priority workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhuangwq committed Mar 14, 2024
1 parent e86d856 commit 8f465dd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/update-low-priority.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: update low priority items based on ADO query

on:
workflow_dispatch:

jobs:
update-low-priority-items:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm install azure-devops-node-api
- uses: actions/github-script@v7
env:
ado_token: '${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}'
query_id: '${{ secrets.ADO_QUERY_ID }}'
with:
script: |
const azdev = require('azure-devops-node-api')
try {
const orgUrl = "https://dev.azure.com/microsoft";
const adoAuthHandler = azdev.getPersonalAccessTokenHandler(process.env.ado_token);
const adoConnection = new azdev.WebApi(orgUrl, adoAuthHandler);
adoClient = await adoConnection.getWorkItemTrackingApi();
} catch (e) {
console.error(e);
core.setFailed('Could not connect to ADO');
return;
}
const queryResult = await adoClient.queryById(process.env.query_id);
console.log(queryResult);

0 comments on commit 8f465dd

Please sign in to comment.