Skip to content

Run job only if folder changed #25669

Answered by BrightRan
nahtnam asked this question in Actions
Jun 16, 2020 · 17 comments · 4 replies
Discussion options

You must be logged in to vote

@nahtnam,

There is not a built-in way to do that. You need to use some commands or actions to list all the modified files and check if all of them are in the db folder.
Suppose the db folder is located at the root of the repository, you can reference to the example below:

jobs:
  check:
    name: Check files
    outputs:
      run_job: ${{ steps.check_files.outputs.run_job }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 2
  - name: check modified files
    id: check_files
    run: |
      echo "=============== list modified files ==============="
      git diff --name-only HEAD^ HEAD
      
      e…

Replies: 17 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@LucBerge
Comment options

Comment options

You must be logged in to vote
1 reply
@LucBerge
Comment options

Comment options

You must be logged in to vote
2 replies
@sdarwin
Comment options

@alobaton-pricesmart
Comment options

Comment options

You must be logged in to vote
0 replies

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment