Skip to content

Commit 9edc574

Browse files
Navdeep SinghCopilot
andcommitted
Sync regression issues to ADO directly from labeler workflow
GitHub Actions events triggered by GITHUB_TOKEN don't trigger other workflows. When regexLabeler adds the 'regression' label, syncAdo.yml never fires. This adds the ADO sync step directly into the labeler workflow (conditional on regression label being present) so regression bugs automatically create ADO work items. Changes: - Added regression label check via github-script - Added conditional Azure login + ADO sync steps - Changed runner to windows-latest (required for Azure CLI action) - Added id-token:write permission for Azure OIDC Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e79867c commit 9edc574

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/regexLabeler.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
types: [opened, edited]
55

66
permissions:
7+
id-token: write
78
issues: write
89
contents: read
910

@@ -27,3 +28,40 @@ jobs:
2728
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2829
assignees: ambikakunnath
2930
includeLabels: regression
31+
32+
# Check if the issue now has the regression label (added by labeler above)
33+
- name: Check for regression label
34+
id: check_regression
35+
uses: actions/github-script@v7
36+
with:
37+
script: |
38+
const labels = await github.rest.issues.listLabelsOnIssue({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
issue_number: context.issue.number
42+
});
43+
const hasRegression = labels.data.some(l => l.name === 'regression');
44+
core.setOutput('has_regression', hasRegression.toString());
45+
46+
# Sync regression issues to ADO directly (syncAdo.yml won't trigger from workflow-added labels)
47+
- name: Azure login
48+
if: steps.check_regression.outputs.has_regression == 'true'
49+
uses: azure/login@v2
50+
with:
51+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
52+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
53+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
54+
55+
- name: Sync regression to ADO
56+
if: steps.check_regression.outputs.has_regression == 'true'
57+
uses: Navdeep-ss/github-actions-issue-to-work-item@simple-sync-azurecli
58+
env:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
label: 'regression'
62+
ado_organization: 'microsoft'
63+
ado_project: 'Edge'
64+
ado_area_path: 'Edge\Web Experience\WebView2'
65+
ado_tags: 'WV2SupportAutoFile'
66+
ado_gh_closed_tag: 'WV2_GitHub_Closed'
67+
update_issue_body: 'false'

0 commit comments

Comments
 (0)