From 1d0e26be91efe79e1aa674d4c8e3159eea4df896 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 18 Mar 2025 16:10:20 -0700 Subject: [PATCH 1/3] delete non-functional workflow --- .github/workflows/backport.yml | 78 ---------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 8c7fd22ccb4..00000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Backport PR to branch -on: - issue_comment: - types: [created] - schedule: - # once a day at 13:00 UTC to cleanup old runs - - cron: '0 13 * * *' - -permissions: - contents: write - issues: write - pull-requests: write - actions: write - -jobs: - label: - if: ${{ contains(github.event.comment.body, '/backport to') }} - runs-on: ubuntu-latest - steps: - - name: Add Label - uses: actions/github-script@v6 - with: - script: | - const comment = context.payload.comment.body; - const match = comment.match(/\/backport to release\/v(\d+\.\d+)$/); - if (match) { - const version = match[1]; - const label = `Backport-${version}.x-Consider`; - console.log(label); - - // Add the label to the issue - await github.rest.issues.addLabels({ - ...context.repo, - issue_number: context.issue.number, - labels: [label], - }); - } else { - throw new Error("No version found in comment. Expected: /backport to release/vN.N"); - } - backport: - if: ${{ contains(github.event.comment.body, '/backport to') || github.event_name == 'schedule' }} - # validates our branch format and that the issue is labeled before backport - needs: label - uses: dotnet/arcade/.github/workflows/backport-base.yml@main - with: - repository_owners: 'powershell,travisez13' - pr_description_template: | - Backport of #%source_pr_number% to %target_branch% - - - - /cc %cc_users% - - ## Customer Impact - - - [ ] Customer reported - - [ ] Found internally - - [Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.] - - ## Regression - - - [ ] Yes - - [ ] No - - [If yes, specify when the regression was introduced. Provide the PR or commit if known.] - - ## Testing - - [How was the fix verified? How was the issue missed previously? What tests were added?] - - ## Risk - - [High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.] - From f75e764b9d88b303ac1f866479046628ee64729b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 18 Mar 2025 16:10:56 -0700 Subject: [PATCH 2/3] update if conditions for workflow jobs --- .github/workflows/AssignPrs.yml | 1 + .github/workflows/linux-ci.yml | 3 ++- .github/workflows/macos-ci.yml | 3 ++- .github/workflows/markdownLink.yml | 2 ++ .github/workflows/processReminders.yml | 1 + .github/workflows/scorecards.yml | 1 + .github/workflows/windows-ci.yml | 3 ++- 7 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/AssignPrs.yml b/.github/workflows/AssignPrs.yml index d398cd7cffe..a01c0bb0950 100644 --- a/.github/workflows/AssignPrs.yml +++ b/.github/workflows/AssignPrs.yml @@ -7,6 +7,7 @@ permissions: jobs: run: + if: github.repository_owner == 'PowerShell' runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 68b651c7e46..cd1ff96f176 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -37,6 +37,7 @@ env: system_debug: 'false' jobs: changes: + if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell' name: Change Detection runs-on: ubuntu-latest # Required permissions @@ -232,7 +233,7 @@ jobs: - linux_test_unelevated_others - analyze if: always() - uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@master + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 with: needs_context: ${{ toJson(needs) }} # TODO: Enable this when we have a Linux packaging workflow diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index b414afebfc9..f024e6513e2 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -38,6 +38,7 @@ jobs: changes: name: Change Detection runs-on: ubuntu-latest + if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell' # Required permissions permissions: pull-requests: read @@ -186,6 +187,6 @@ jobs: - macos_test_unelevated_ci - macos_test_unelevated_others if: always() - uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@master + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 with: needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/markdownLink.yml b/.github/workflows/markdownLink.yml index b451885acea..88f9992f559 100644 --- a/.github/workflows/markdownLink.yml +++ b/.github/workflows/markdownLink.yml @@ -10,6 +10,8 @@ permissions: jobs: markdown-link-check: runs-on: ubuntu-latest + if: github.repository_owner == 'PowerShell' + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1 diff --git a/.github/workflows/processReminders.yml b/.github/workflows/processReminders.yml index 82734c829d6..f1e66e0d4e8 100644 --- a/.github/workflows/processReminders.yml +++ b/.github/workflows/processReminders.yml @@ -10,6 +10,7 @@ permissions: jobs: reminder: + if: github.repository_owner == 'PowerShell' permissions: issues: write # for agrc/reminder-action to set reminders on issues pull-requests: write # for agrc/reminder-action to set reminders on PRs diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 7651d3f1959..6eea3e2404a 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -20,6 +20,7 @@ permissions: read-all jobs: analysis: name: Scorecard analysis + if: github.repository_owner == 'PowerShell' runs-on: ubuntu-latest permissions: # Needed to upload the results to code-scanning dashboard. diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index c93983a765f..27f85578673 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -39,6 +39,7 @@ jobs: changes: name: Change Detection runs-on: ubuntu-latest + if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell' # Required permissions permissions: pull-requests: read @@ -170,6 +171,6 @@ jobs: - windows_test_unelevated_ci - windows_test_unelevated_others if: always() - uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@master + uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 with: needs_context: ${{ toJson(needs) }} From 0ec493e1dd3405fad53ad8de86c7301eb689f27e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 19 Mar 2025 15:36:13 -0700 Subject: [PATCH 3/3] Update workflow conditions and paths-filter action version --- .github/workflows/createReminders.yml | 2 ++ .github/workflows/labels.yml | 2 +- .github/workflows/linux-ci.yml | 2 +- .github/workflows/macos-ci.yml | 2 +- .github/workflows/windows-ci.yml | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/createReminders.yml b/.github/workflows/createReminders.yml index 3e8c0180b3d..17080e945ab 100644 --- a/.github/workflows/createReminders.yml +++ b/.github/workflows/createReminders.yml @@ -9,6 +9,8 @@ permissions: jobs: reminder: + if: github.repository_owner == 'PowerShell' + permissions: issues: write # for agrc/create-reminder-action to set reminders on issues pull-requests: write # for agrc/create-reminder-action to set reminders on PRs diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 794ef64b213..fdb0ae4cd77 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -13,7 +13,7 @@ permissions: jobs: verify-labels: - if: github.repository_owner == 'PowerShell' + if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index cd1ff96f176..d7d76310846 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v4.1.0 # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v3 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0 id: filter with: list-files: json diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index f024e6513e2..d7d5dc76d0b 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v4.1.0 # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v3 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0 id: filter with: list-files: json diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 27f85578673..9f2aef06a59 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v4.1.0 # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v3 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0 id: filter with: list-files: json