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-update-check-action 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.
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 - Whether to run npm-update-check-action. 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
.
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@v1.6.0
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 }}
# 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: false
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.