{"id":14963573,"url":"https://github.com/dotnet/versionsweeper","last_synced_at":"2025-04-06T01:07:19.977Z","repository":{"id":38305233,"uuid":"329435923","full_name":"dotnet/versionsweeper","owner":"dotnet","description":"🎯 LTS (or current) versions - GitHub Action that will run as a scheduled CRON job. Ideally, once every few months or as often as necessary to align with .NET version updates.","archived":false,"fork":false,"pushed_at":"2025-03-19T13:10:24.000Z","size":5447,"stargazers_count":60,"open_issues_count":22,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-30T00:11:06.672Z","etag":null,"topics":["cron","csharp","dotnet","hacktoberfest","version-check"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-13T21:28:38.000Z","updated_at":"2025-03-28T03:11:10.000Z","dependencies_parsed_at":"2024-05-21T03:45:33.823Z","dependency_job_id":"b4119da7-9402-4a76-a955-152b7e6bf954","html_url":"https://github.com/dotnet/versionsweeper","commit_stats":{"total_commits":162,"total_committers":6,"mean_commits":27.0,"dds":0.0679012345679012,"last_synced_commit":"111c032751a7552634a482db4e326786f4a0afc4"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fversionsweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fversionsweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fversionsweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fversionsweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnet","download_url":"https://codeload.github.com/dotnet/versionsweeper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","csharp","dotnet","hacktoberfest","version-check"],"created_at":"2024-09-24T13:31:48.752Z","updated_at":"2025-04-06T01:07:19.947Z","avatar_url":"https://github.com/dotnet.png","language":"C#","funding_links":[],"categories":["hacktoberfest","csharp"],"sub_categories":[],"readme":"﻿# 🎯 LTS (or STS) versions\n## .NET version sweeper\n\n[![build \u0026 test](https://github.com/dotnet/versionsweeper/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/dotnet/versionsweeper/actions/workflows/build-and-test.yml)\n[![target supported version](https://github.com/dotnet/versionsweeper/actions/workflows/dog-food.yml/badge.svg)](https://github.com/dotnet/versionsweeper/actions/workflows/dog-food.yml)\n[![code-ql analysis](https://github.com/dotnet/versionsweeper/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/dotnet/versionsweeper/actions/workflows/codeql-analysis.yml)\n[![GitHub marketplace](https://img.shields.io/badge/marketplace-.NET%20version%20sweeper-green?colorA=24292e\u0026colorB=97ca00\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/net-version-sweeper)\n[![GitHub license](https://img.shields.io/github/license/dotnet/versionsweeper)](https://github.com/dotnet/versionsweeper/blob/main/LICENSE)\n[![GitHub contributors](https://img.shields.io/github/contributors/dotnet/versionsweeper.svg)](https://GitHub.com/dotnet/versionsweeper/graphs/contributors/)\n[![GitHub repo size](https://img.shields.io/github/repo-size/dotnet/versionsweeper)](https://github.com/dotnet/versionsweeper)\n[![GitHub issues-opened](https://img.shields.io/github/issues/dotnet/versionsweeper.svg)](https://GitHub.com/dotnet/versionsweeper/issues?q=is%3Aissue+is%3Aopened)\n[![GitHub issues-closed](https://img.shields.io/github/issues-closed/dotnet/versionsweeper.svg)](https://GitHub.com/dotnet/versionsweeper/issues?q=is%3Aissue+is%3Aclosed)\n[![GitHub pulls-opened](https://img.shields.io/github/issues-pr/dotnet/versionsweeper.svg)](https://GitHub.com/dotnet/versionsweeper/pulls?q=is%3Aissue+is%3Aopened)\n[![GitHub pulls-merged](https://img.shields.io/github/issues-search/dotnet/versionsweeper?label=merged%20pull%20requests\u0026query=is%3Apr%20is%3Aclosed%20is%3Amerged\u0026color=darkviolet)](https://github.com/dotnet/versionsweeper/pulls?q=is%3Apr+is%3Aclosed+is%3Amerged)\n[![GitHub pulls-unmerged](https://img.shields.io/github/issues-search/dotnet/versionsweeper?label=unmerged%20pull%20requests\u0026query=is%3Apr%20is%3Aclosed%20is%3Aunmerged\u0026color=red)](https://github.com/dotnet/versionsweeper/pulls?q=is%3Apr+is%3Aclosed+is%3Aunmerged)\n\n## Get started\n\nThe .NET version sweeper is designed to alert repositories (by either creating issues, pull requests, or both) that there are projects targeting versions that are no longer supported (or won't be soon). For example, projects targeting .NET Core 3.0 or .NET Framework 4.5.1 could trigger an issue to be created to update these projects to supported versions, or even a pull request that upgrades it for you. For example issues, see [issues created in this repo based on the *non-lts* directory](https://github.com/dotnet/versionsweeper/issues?q=is%3Aopen+is%3Aissue+label%3Adotnet-target-version).\n\nThis is intended to be used as a GitHub action that will run as a [scheduled CRON job](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule). Ideally, once a month or as often as necessary to align with .NET version updates.\n\nA schedule/cron job that runs on the first of every month is detailed below in the [example workflow](#example-workflow), `'0 0 1 * *'`.\n\n## Required inputs\n\n| Option         | Details                                                                                                                |\n|:---------------|:-----------------------------------------------------------------------------------------------------------------------|\n| `-o`, `owner`  | The owner of the repo.\u003cbr\u003eAssign from `${{ github.repository_owner }}`. Example, `\"dotnet\"`.                           |\n| `-n`, `name`   | The repository name.\u003cbr\u003eAssign from `${{ github.repository }}`. Example, `\"dotnet/samples\"`.                           |\n| `-b`, `branch` | The branch name.\u003cbr\u003eAssign from `${{ github.ref }}`. Example, `\"main\"`.                                                |\n| `-t`, `token`  | The GitHub personal-access token (PAT), or the token from GitHub action context.\u003cbr\u003eAssign from `${{ github.token }}`. |\n\n## Optional inputs\n\n| Option                 | Details                                                                                |\n|:-----------------------|:---------------------------------------------------------------------------------------|\n| `-d`, `dir`            | The root directory, defaults to `\"/github/workspace\"`.                                 |\n| `-p`, `pattern`        | The search pattern, defaults to `\"*.csproj;*.fsproj;*.vbproj;*.xproj;project.json\"`.   |\n| `-s`, `sdk-compliance` | Whether or not to report projects that are not using the new SDK-style project format. |\n\n## GitHub Action outputs\n\n| Output               | Type       | Details                                                                                                    |\n|:---------------------|:-----------|:-----------------------------------------------------------------------------------------------------------|\n| `has-remaining-work` | `bool`     | When `true`, the `upgrade-projects` array will be populated with project directories that require upgrade. |\n| `upgrade-projects`   | `string[]` | An array of project directories that are in need of being upgraded.                                        |\n\n\u003e **Note**\n\u003e Outputs are only present when configured to run as pull request mode. For more information, see [Configure action](#configure-action).\n\n## Example workflow\n\n```yml\n# This is a basic workflow to help you get started with Actions\n\nname: \"target supported version\"\n\n# Controls when the action will run.\non:\n  # Triggers the workflow on push or pull request events but only for the default branch\n  schedule:\n    - cron: \"0 0 1 * *\"\n  workflow_dispatch:\n    inputs:\n      reason:\n        description: \"The reason for running the workflow\"\n        required: true\n        default: \"Manual run\"\n      support:\n        description: \"The support level to target (STS, LTS, or Preview).\"\n        required: true\n        default: \"STS\"\n\n# A workflow run is made up of one or more jobs that can run sequentially or in parallel\njobs:\n  # This workflow contains a single job called \"build\"\n  version-sweep:\n    # The type of runner that the job will run on\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n      pull-requests: write\n\n    # Steps represent a sequence of tasks that will be executed as part of the job\n    steps:\n      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it\n      - uses: actions/checkout@v3\n\n      # Runs a single command using the runners shell\n      - name: \"Print manual run reason\"\n        if: ${{ github.event_name == 'workflow_dispatch' }}\n        run: |\n          echo 'Reason: ${{ github.event.inputs.reason }}'\n\n      # Start the .NET version sweeper, scan projects/slns for non-LTS (or currrent) versions\n      - name: .NET version sweeper\n        id: dotnet-version-sweeper\n        uses: dotnet/versionsweeper@main\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          owner: ${{ github.repository_owner }}\n          name: ${{ github.repository }}\n          branch: ${{ github.ref }}\n      \n      - name: Create pull requests\n        if: steps.dotnet-version-sweeper.outputs.has-remaining-work == 'true'\n        run: |\n          upgradeProjects: ${{ steps.dotnet-version-sweeper.outputs.upgrade-projects }}\n\n          # Install .NET Upgrade Assistant global tool\n          dotnet tool install --global upgrade-assistant\n\n          # Iterate all upgrade projects\n          for projectDir in \"${upgradeProjects[@]}\"; do\n            echo \"Project Directory: $projectDir\"\n\n            # Create a new branch\n            git checkout -b upgrade/$projectDir\n\n            # Perform the upgrade using upgrade-assistant\n            upgrade-assistant upgrade \"$projectDir\" --non-interactive -t ${{ inputs.support }}\n\n            # Commit the changes\n            git add .\n            git commit -m \".NET Version Sweeper: Upgraded $projectDir\"\n\n            # Push the branch to the repository\n            git push origin upgrade/$projectDir\n\n            # Create a pull request\n            gh pr create \\\n              --base main \\\n              --head upgrade/$projectDir \\\n              --title \"Upgraded $projectDir\" \\\n              --body \"Proposed upgrade for $projectDir\"\n          done\n```\n\n## Project and solution discovery\n\nThe .NET version sweeper currently supports reporting on all of the following types:\n\n- C# project files: `*.csproj`\n- F# project files: `*.fsproj`\n- VB project files: `*.vbproj`\n- DNX project files: `*.xproj`\n- Project JSON files: `project.json`\n- Solution files: `*.sln`\n\n## Dockerfile discovery\n\nThe .NET version sweeper also supports reporting _Dockerfile_ target frameworks that are out-of-support, or soon to be, for example:\n\n- `FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8`\n- `COPY --from=mcr.microsoft.com/dotnet/framework/runtime:3.5-20221011-windowsservercore-ltsc2019`\n\n## Configure action\n\nTo configure the action, you can create a file at the root of the repository named *dotnet-versionsweeper.json*. This config file contains a node, named `\"ignore\"` that is an array of patterns following the [globbing matcher detailed here](https://docs.microsoft.com/dotnet/api/microsoft.extensions.filesystemglobbing.matcher#remarks).\n\nThe file can also contain a value `outOfSupportWithinDays` to specify the number of additional days to consider flagging versions that will be out of support.\n\n```json\n{\n  \"ignore\": [\n    \"**/SomePath/**/*.csproj\",\n    \"**/*ThisShouldNeverBeFlagged.csproj\",\n    \"IgnoreDir/**/*.*\"\n  ],\n  \"outOfSupportWithinDays\": 90,\n  \"actionType\": \"All\"\n}\n```\n\nFor an example config file, see [dotnet/samples/dotnet-versionsweeper.json](https://github.com/dotnet/samples/blob/master/dotnet-versionsweeper.json).\n\n| Configuration | Type |  Details |\n|:--|:--|:--|\n| `ignore` | `string[]` | Glob patterns to ignore. |\n| `outOfSupportWithinDays` | `string[]` | The number of days in advance to monitor for. |\n| `actionType` | `ActionType` \u003cbr\u003e\u003cbr\u003e \u0026nbsp;\u0026nbsp; `\"CreateIssue\"` \u003cbr\u003e \u0026nbsp;\u0026nbsp; `\"PullRequest\"` \u003cbr\u003e \u0026nbsp;\u0026nbsp; `\"All\"` | The type of action to take, defaults to `CreateIssue`.  |\n\n## Label auto-generation\n\nThis tool will create a label named `dotnet-target-version` for easier tracking of issues and pull requests that it creates. The label is created with the following description and color by default, please do not change the name - as that is what is used to determine whether or not to create a new label.\n\n- `Description`: \"Issues and PRs automatically generated from the .NET version sweeper.\"\n- `Color`: [Official .NET purple #512bd4](https://hexcolorcodes.org/hex-code/512BD4)\n\n### Example labels in the wild\n\n- [dotnet/doc](https://github.com/dotnet/docs/labels/dotnet-target-version)\n- [dotnet/samples](https://github.com/dotnet/samples/labels/dotnet-target-version)\n- [dotnet/versionsweeper](https://github.com/dotnet/versionsweeper/labels/dotnet-target-version)\n\n## Example issues\n\nThis repo serves as a sample, as it contains a directory *non-lts* with projects and solutions that are intentionally targeting unsupported versions. There are issues created against these to exemplify how they render. For more information, see [these issues](https://github.com/IEvangelist/dotnet-versionsweeper/issues?q=is%3Aopen+is%3Aissue+label%3Aexample-issue).\n\n## Official .NET support policies\n\nThis action is intended to help determine non-LTS (or STS) versions, but it _isn't_ perfect. When in doubt, please refer to the [official .NET support policies](https://dotnet.microsoft.com/platform/support/policy).\n\n## Acknowledgements\n\n| Name | NuGet package URL \u0026 license |\n|:-|:-|\n| `CommandLineParser` | [https://www.nuget.org/packages/CommandLineParser](https://www.nuget.org/packages/CommandLineParser) ([MIT](https://www.nuget.org/packages/CommandLineParser/2.8.0/License)) |\n| `MarkdownBuilder` | [https://www.nuget.org/packages/MarkdownBuilder](https://www.nuget.org/packages/MarkdownBuilder) ([MIT](https://licenses.nuget.org/MIT)) |\n| `NSubstitute` | [https://www.nuget.org/packages/NSubstitute](https://www.nuget.org/packages/NSubstitute) ([LICENSE](https://github.com/nsubstitute/NSubstitute/blob/master/LICENSE.txt)) |\n| `Octokit` | [https://www.nuget.org/packages/Octokit](https://www.nuget.org/packages/Octokit) ([MIT](https://licenses.nuget.org/MIT)) |\n| `Octokit.Extensions` | [https://www.nuget.org/packages/Octokit.Extensions](https://www.nuget.org/packages/Octokit.Extensions) ([MIT](https://github.com/mirsaeedi/octokit.net.Extensions/blob/master/LICENSE)) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet%2Fversionsweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnet%2Fversionsweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet%2Fversionsweeper/lists"}