Github action for reporting on outdated dotnet packages in a solution or project, or npm packages in a project directory.
This action will run either or both of:
- dotnet-outdated against a supplied dotnet solution or project
- npm outdated against a supplied npm project directory
Note
The intention of this action is purely to notify of any outdated packages and not to perform any kind of update action.
Reports for any outdated packages found are added as a comment to the pull request used to run this action.
If the action is re-run against a pull request that has already been commented on, the existing comment will be updated.
v1.7.0, v2.0.0 and v3.x.x of this action are functionally identical, except v1.7.0 defaults to using dotnet 8.*.*, v2.0.0 defaults to using dotnet 9.*.* and v3.x.x defaults to using dotnet 10.*.*.
v3.x.x also updates action dependencies to latest major versions (npm update check now uses node 20).
Warning
This action is designed to be actioned only within the context of a pull request, no other scenarios are catered for.
Optional - Whether to run dotnet-outdated. Default false.
Optional - The path to the dotnet solution or project file. Required if use-dotnet-outdated is true.
Optional - Names of packages to exclude from the check. Optional if use-dotnet-outdated is true. Space delimited string of package names, e.g. "Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Abstractions"
Optional - The version of dotnet to use. Default 10.*.*.
Optional - Whether to run npm outdated. Default false.
Optional - The path to the npm project directory. Default ..
Optional - When true, don't add a success comment to the PR when checks are successful. Default false.
Optional - A label used to distinguish this run's PR comment, e.g. a matrix variant name. It is included in the comment's hidden identifier so parallel matrix jobs each update their own comment instead of overwriting one another, and is shown at the top of the comment. If omitted, the npm project directory / dotnet solution path is used to differentiate comments. Default ''.
outdated.yml
name: Outdated package checks
# Run workflow on pull request to the main branch
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main ]
env:
SOLUTION_PATH: 'src/RobGreenEngineering.sln'
PROJECT_DIR: 'src/RobGreenEngineering'
EXCLUDE_PACKAGES: 'Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Abstractions'
jobs:
outdated-packages-check:
runs-on: ubuntu-latest
# grant pull request write permission if 'Read and write permissions' is not active for actions in the repository
permissions:
pull-requests: write
steps:
- uses: trossr32/outdated-packages-action@v4
with:
# Whether to run dotnet-outdated. Default is false if not supplied.
use-dotnet-outdated: true
# The path to the dotnet solution or project file. Required if use-dotnet-outdated is true.
dotnet-solution-or-project-path: ${{ env.SOLUTION_PATH }}
# Names of packages to exclude from the check. Optional if use-dotnet-outdated is true.
# Space delimited string of package names, e.g. "Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Abstractions"
dotnet-exclude-packages: ${{ env.EXCLUDE_PACKAGES }}
# The version of dotnet to use. Default is 10.*.*.
dotnet-version: '10.*.*'
# Whether to run npm-update-check-action. Default is false if not supplied.
use-npm-outdated: true
# The path to the npm project directory.
# Default is '.', so only required if the npm project is not the root of the repository.
npm-project-directory: ${{ env.PROJECT_DIR }}
# When true, don't add a success comment to the PR when checks are successful. Default is false if not supplied.
hide-successful-checks: falseWhen checking multiple projects/directories in parallel with a matrix, each job posts its own PR comment. Comments are differentiated automatically by npm-project-directory / dotnet-solution-or-project-path; set comment-label to give each comment a friendlier title.
outdated.yml
name: Outdated package checks
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main ]
jobs:
outdated-packages-check:
runs-on: ubuntu-latest
name: Check outdated packages (${{ matrix.name }})
permissions:
pull-requests: write
strategy:
fail-fast: false
matrix:
include:
- name: project root
directory: '.'
- name: playwright tests
directory: 'tests/playwright'
steps:
- uses: trossr32/outdated-packages-action@v4
with:
use-npm-outdated: true
npm-project-directory: ${{ matrix.directory }}
# Optional: titles the comment and keeps each variant's comment separate
comment-label: ${{ matrix.name }}This action leverages these projects:
Please create a pull request and get in touch. Alternatively feel free to raise an issue if you've found a bug or want to suggest a new feature.



