Skip to content

Commit 2e7fa8d

Browse files
authored
🔧 (close-pr.yaml): Add condition to skip workflow for forked repositories to optimize resource usage (#2447)
🔧 (close-pr.yaml): add condition to skip workflow for forked repositories Add a conditional check to ensure the workflow only runs on pull requests from the main repository, not from forks. This prevents unnecessary execution of the workflow on forked repositories, optimizing resource usage and maintaining focus on relevant pull requests.
2 parents 62222cf + 9e66cf1 commit 2e7fa8d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

‎.github/workflows/close-pr.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
pr_cleanup:
99
runs-on: ubuntu-latest
10+
if: ${{ !(github.event.pull_request.head.repo.fork) }}
1011
steps:
1112
- uses: actions/create-github-app-token@v1
1213
id: app-token
@@ -18,6 +19,7 @@ jobs:
1819
with:
1920
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
2021
action: 'close'
22+
deployment_environment: canary-${{ github.event.pull_request.number }}
2123
app_location: ''
2224
skip_app_build: true
2325
skip_api_build: true

‎.github/workflows/main.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Canary";
135135
$docs_deploy_folder = "./azure-devops-migration-tools/canary/$branchSafeName"
136136
$docs_baseURL = "/learn/azure-devops-migration-tools/canary/$branchSafeName"
137-
$AzureSitesEnvironment = "$branchSafeName"
137+
$AzureSitesEnvironment = "canary-${{ github.event.pull_request.number }}"
138138
$RunRelease = 'false'
139139
}
140140
}
@@ -456,7 +456,13 @@ jobs:
456456
Version: ${{ needs.Setup.outputs.GitVersion_SemVer }}
457457
Ring: (${{ needs.Setup.outputs.nkdAgility_Ring }})
458458
459-
${{ needs.Setup.outputs.nkdAgility_ReleaseDescription }}
459+
---
460+
Funding for us doing work on this tool is generally through 1) customer funding, or 2) donated free time.
461+
462+
[Sponcer a Feature](https://github.com/sponsors/nkdAgility) | [Hire us directly](https://nkdagility.com/capabilities/azure-devops-migration-services/)
463+
---
464+
465+
${{ needs.Setup.outputs.nkdAgility_ReleaseDescription }}
460466
461467
## Get the tools
462468

0 commit comments

Comments
 (0)