Skip to content

Commit f2c9e60

Browse files
authored
Merge pull request #5555 from MicrosoftEdge/user/singhnavdeep/regression-ado-sync
Sync regression issues to ADO directly from labeler workflow
2 parents e79867c + 9edc574 commit f2c9e60

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)