diff --git a/.github/workflows/check-for-modules.yml b/.github/workflows/check-for-modules.yml new file mode 100644 index 000000000000..c24811797f1e --- /dev/null +++ b/.github/workflows/check-for-modules.yml @@ -0,0 +1,45 @@ +name: pr-new-modules +run-name: Triggered by pr +env: + GH_TOKEN: ${{ github.token }} + PR: ${{ github.event.pull_request.html_url }} +on: + pull_request_target: + types: + - opened + - edited +jobs: + process_labels: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: read + steps: + - uses: actions/checkout@v6 + with: + sparse-checkout: | + .github + + - name: Fetch PR Head + run: git fetch origin refs/pull/${{ github.event.pull_request.number }}/head:pr-head + + - name: Fetch comparison branch + run: git fetch origin ${{ github.base_ref }} + + - name: check for new modules + shell: pwsh + env: + BASE_REF: ${{ github.base_ref }} + run: | + $files = @(git diff ` + origin/$env:BASE_REF..pr-head ` + --diff-filter=A ` + --name-only ` + -- '**/*.sln') + + if ($files.Count -gt 0) { + Write-Host "Detected a new module" + gh pr edit "$env:PR" --add-label "new module" + } else { + Write-Host "No new module detected" + } diff --git a/src/Accounts/Accounts.sln b/src/Accounts/Accounts.sln index 0354bb56e5e8..84aa9bd49c35 100644 --- a/src/Accounts/Accounts.sln +++ b/src/Accounts/Accounts.sln @@ -1,5 +1,4 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"