From eb9d0eaa65f183e652b58ba0a996b212eca3005d Mon Sep 17 00:00:00 2001 From: wenyt <75360946+wenytang-ms@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:59:32 +0800 Subject: [PATCH] ci: update the cherry-pick workflow actions (#12860) * test: bot notify * ci: update * ci: update the cherry pick workflow --- .github/actions/issue-labeled/azdo.ts | 2 +- .github/actions/issue-labeled/index.ts | 2 +- .github/workflows/issue-labeled.yml | 2 +- .github/workflows/lint-pr.yml | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/issue-labeled/azdo.ts b/.github/actions/issue-labeled/azdo.ts index c0d060ed4c..fc637862e9 100644 --- a/.github/actions/issue-labeled/azdo.ts +++ b/.github/actions/issue-labeled/azdo.ts @@ -100,7 +100,7 @@ export class DevopsClient { tagsValue, url, 'Bug', - sprintPath??this.bugIteration, + this.bugIteration, ); } diff --git a/.github/actions/issue-labeled/index.ts b/.github/actions/issue-labeled/index.ts index 2e59b7577a..974496acf2 100644 --- a/.github/actions/issue-labeled/index.ts +++ b/.github/actions/issue-labeled/index.ts @@ -46,7 +46,7 @@ class Labeled extends Action { const url = this.issueUrl(content.number); const title = titlePreix + content.title; let workItem: WorkItemTrackingInterfaces.WorkItem; - safeLog(`issue labeled with ${bugLabel}. Bug work item will be created.`); + safeLog(`issue labeled with ${bugLabel}. Bug work item will be created. ${sprintPath}`); workItem = await client.createBugItem(title, asignee, undefined, url, sprintPath); safeLog(`finished to create work item.`); const workItemUrl = workItem._links?.html?.href; diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 63ce4ede99..485bc11b26 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -11,7 +11,7 @@ on: jobs: main: - if: ${{contains(github.event.issue.labels.*.name, 'cherry-pick-hotfix')}} + if: ${{contains(github.event.issue.labels.*.name, 'cherry-pick-hotfix') || github.event_name == 'workflow_dispatch'}} runs-on: ubuntu-latest environment: engineering permissions: diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 261ff29cd4..f1d3162f37 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -6,6 +6,9 @@ on: - opened - edited - synchronize + push: + branches: + - release/* schedule: - cron: "0 8 * * *" @@ -240,7 +243,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} create-cherry-pick-issue: - if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release') && github.event.action == 'opened' }} + if: ${{ github.event_name == 'push' && !contains(github.event.pull_request.labels.*.name, 'cherry-pick-hotfix') }} runs-on: ubuntu-latest permissions: contents: read