'Is it possible to not run github action for readme updates?

I have the following action on Github actions that automatically packs and deploy a package to nuget.org every time a PR gets merged into master.

name: Nuget Deploy

on:
  push:
    branches: [ master ]

jobs:
  build:

    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
    - name: Generate Nuget package
      run: dotnet pack
      working-directory: DateOverride
    - name: Deploy to nuget.org
      run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_DEPLOY_KEY }} -s https://api.nuget.org/v3/index.json
      working-directory: DateOverride/DateOverride/bin/Debug

But I would like that it was not run if my update is only a README.md update, is it possible to do so?



Solution 1:[1]

You might want to combine your current GitHiub Action with another like MarceloPrado/has-changed-path

This action outputs whether a path or combination of paths has changed in the previous commit.
[This] action is meant to be used inside your job steps, not at the root of your workflow file

Or (opposite filter): dorny/paths-filter

With this Github Action you can execute your workflow steps only if relevant files are modified.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC