Skip to content

Commit

Permalink
🔧 (close-pr.yaml): Add condition to skip workflow for forked reposito…
Browse files Browse the repository at this point in the history
…ries 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.
  • Loading branch information
MrHinsh authored Oct 9, 2024
2 parents 62222cf + 9e66cf1 commit 2e7fa8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/close-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
pr_cleanup:
runs-on: ubuntu-latest
if: ${{ !(github.event.pull_request.head.repo.fork) }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
Expand All @@ -18,6 +19,7 @@ jobs:
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: 'close'
deployment_environment: canary-${{ github.event.pull_request.number }}
app_location: ''
skip_app_build: true
skip_api_build: true
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Canary";
$docs_deploy_folder = "./azure-devops-migration-tools/canary/$branchSafeName"
$docs_baseURL = "/learn/azure-devops-migration-tools/canary/$branchSafeName"
$AzureSitesEnvironment = "$branchSafeName"
$AzureSitesEnvironment = "canary-${{ github.event.pull_request.number }}"
$RunRelease = 'false'
}
}
Expand Down Expand Up @@ -456,7 +456,13 @@ jobs:
Version: ${{ needs.Setup.outputs.GitVersion_SemVer }}
Ring: (${{ needs.Setup.outputs.nkdAgility_Ring }})
${{ needs.Setup.outputs.nkdAgility_ReleaseDescription }}
---
Funding for us doing work on this tool is generally through 1) customer funding, or 2) donated free time.
[Sponcer a Feature](https://github.com/sponsors/nkdAgility) | [Hire us directly](https://nkdagility.com/capabilities/azure-devops-migration-services/)
---
${{ needs.Setup.outputs.nkdAgility_ReleaseDescription }}
## Get the tools
Expand Down

0 comments on commit 2e7fa8d

Please sign in to comment.