Determines which versions of .NET are in use and persists them to a JSON file.
The action is typically used to keep an up-to-date manifest of dotnet versions in use in the current repository, so the dotnet-env can automatically set up the environment via a single step.
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**/*.*proj'
jobs:
which-dotnet:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
- name: 🤌 dotnet
uses: devlooped/actions-which-dotnet@v1
- name: ✍ pull request
uses: peter-evans/create-pull-request@v7
with:
base: main
branch: which-dotnet
delete-branch: true
labels: dependencies
title: "⚙ Update dotnet versions"
body: "Update dotnet versions"
commit-message: "Update dotnet versions"The action will output a JSON file containing an array of the major versions used by dotnet projects (`**/*.*proj) in the entire repository, such as:
[
"6.x",
"8.x",
"10.x"
]The default JSON output location is ./.github/dotnet.json. This can
be changed by specifying the versions parameter:
- name: 🤌 dotnet
uses: devlooped/actions-which-dotnet@v1
with:
versions: ./dotnet.json