Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/snippets5000.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Snippets 5000'

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
pull_request:
description: 'The pull request number to build'
required: true
type: number

env:
DOTNET_VERSION: '11.0.x'
DOTNET_QUALITY: 'preview'
EnableNuGetPackageRestore: 'True'

permissions:
contents: read
pull-requests: read

jobs:
snippets-build:
runs-on: windows-2022

steps:
- name: Harden Runner
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/merge', inputs.pull_request) || github.ref }}
persist-credentials: false

- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
10.0.x
${{ env.DOTNET_VERSION }}
dotnet-quality: ${{ env.DOTNET_QUALITY }}

- name: Display .NET info
run: dotnet --info

- name: Clone docs-tools repository
run: git clone --depth 1 https://github.com/dotnet/docs-tools

- name: Run snippets 5000 for PR
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
ExtensionsCodeTriggers: .cs;.vb;.fs;.xaml;.razor;.cshtml;.vbhtml;.sln;.slnx;.csproj;.fsproj;.vbproj;.proj
ExtensionsProjects: .sln;.slnx;.csproj;.fsproj;.vbproj;.proj
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pull_request }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
run: |
dotnet run --project docs-tools\snippets5000\Snippets5000\Snippets5000.csproj -- --sourcepath "$env:GITHUB_WORKSPACE" --pullrequest "$env:PR_NUMBER" --owner "$env:REPOSITORY_OWNER" --repo "$env:REPOSITORY_NAME"
115 changes: 0 additions & 115 deletions .github/workflows/validate-samples.yml

This file was deleted.

31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contribute to the ASP.NET Core documentation

This document covers the process for contributing Blazor sample apps for the [ASP.NET documentation site](https://learn.microsoft.com/aspnet/).

## How to make a simple correction or suggestion

Simple changes are made in the browser by selecting the **Edit** link in the upper-right corner of the browser window. (In a narrow browser window, expand the **options** bar to see the **Edit** link.) Follow the directions to create a pull request (PR). We will review the PR and accept it or suggest changes.

## How to make a more complex submission

You need a basic understanding of [Git and GitHub.com](https://guides.github.com/activities/hello-world/).

* Open an [issue](https://github.com/dotnet/blazor-samples/issues) describing what you want to do. Wait for approval from the team before you invest much time.
* Fork the [`dotnet/blazor-samples` GitHub repository](https://github.com/dotnet/blazor-samples) and create a branch for your changes.
* Submit a PR to the *main* branch with your changes.
* If your PR has the label 'cla-required' assigned, [complete the Contribution License Agreement (CLA)](https://cla.dotnetfoundation.org/).
* Respond to PR feedback.

## Code compilation checks

The **Snippets 5000** workflow runs for pull requests that target `main`. It uses [Snippets5000](https://github.com/dotnet/docs-tools/tree/main/snippets5000) to discover and compile sample projects and solutions affected by changes to code files, Razor files, project files, solution files, or build configuration files such as `global.json` and `snippets.5000.json`.

Review compilation errors in the workflow logs and fix failures in the affected samples before merging. The workflow runs on Windows with the .NET 11 preview SDK and the .NET 10 SDK and runtime.

To rerun the check manually, select **Actions** > **Snippets 5000** > **Run workflow** and enter the pull request number. The workflow checks out that pull request's merge ref and builds its affected samples.

## Related content

* [Contribute to the ASP.NET Core documentation](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md)
* [Funamentals: Razor components](https://learn.microsoft.com/aspnet/core/blazor/fundamentals/#razor-components)
* [ASP.NET Core Razor components: Razor syntax](https://learn.microsoft.com/aspnet/core/blazor/components/#razor-syntax)