Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elements in 'do_not_skip' must be one of "pull_request", "push", "workflow_dispatch", "schedule", "release" #274

Closed
benshabatnoam opened this issue Sep 22, 2022 · 9 comments

Comments

@benshabatnoam
Copy link

Hi,
We're getting this error the first time today and we never changed our yml file.
Could this be because of this PR (#273) that was merged 3 hours ago?
Snag_280c8b8c

@benshabatnoam
Copy link
Author

OK, I can confirm 100% sure that this is a v5 error. I just re-run the same commit using v4 and it works...
Snag_281dd600

@paescuj
Copy link
Collaborator

paescuj commented Sep 22, 2022

So what does your do_not_skip input look like?

@benshabatnoam
Copy link
Author

do_not_skip: '["functions/**", "push", "workflow_dispatch", "schedule"]'
I guess that's (functions/**) not support with v5 anymore?

@paescuj
Copy link
Collaborator

paescuj commented Sep 22, 2022

Hmm, where does functions/** come from? As far as I know this is not a valid trigger, see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows.

@benshabatnoam
Copy link
Author

I see. So if I got it right, you're saying that the do_not_skip key is meant for triggered event?
If so, how can we achieve our original goal to 'do_no_skip' the process once there are changes to the functions folder?

@paescuj
Copy link
Collaborator

paescuj commented Sep 23, 2022

I see. So if I got it right, you're saying that the do_not_skip key is meant for triggered event?

Exactly! See also the documentation for the do_not_skip input.

If so, how can we achieve our original goal to 'do_no_skip' the process once there are changes to the functions folder?

That depends on your exact goal:

  • If you want to run the workflow only if there are some changes in the functions folder, you can use the paths input:

    paths: '["functions/**"]'

    With this option the workflow will be skipped if there are changes to other files but ones in the functions folder or if the exact same files have already been successfully checked in an older run (see https://github.com/fkirc/skip-duplicate-actions#option-3-look-for-successful-checks-of-previous-commits).

  • If you want to run the workflow if there are any changes (including files in the functions folder) you don't need to set any special option because this is already the default behavior of skip-duplicate-actions.

  • If you want to never skip the workflow if there are some changes in the functions folder, regardless if the exact same files have already been successfully checked in an older run, you could probably (not tested!) use something like this:

    pre_job:
      runs-on: ubuntu-latest
      outputs:
        should_skip: ${{ steps.skip_check.outputs.should_skip }}
        paths_result: ${{ steps.skip_check.outputs.paths_result }}
      steps:
        - id: skip_check
          uses: fkirc/skip-duplicate-actions@v5
          with:
            skip_after_successful_duplicate: 'false' # Important!
            paths_filter: |
              functions:
                paths:
                  - 'functions/**'
    
    example_job:
      needs: pre_job
      if: '!fromJSON(needs.pre_job.outputs.paths_result).global.should_skip || !fromJSON(needs.pre_job.outputs.paths_result).functions.should_skip'
      # ...

@paescuj
Copy link
Collaborator

paescuj commented Sep 24, 2022

Closing this as I assume the problem could be solved.

@paescuj paescuj closed this as completed Sep 24, 2022
@benshabatnoam
Copy link
Author

@paescuj thanks for the awesome support.

@paescuj
Copy link
Collaborator

paescuj commented Sep 24, 2022

You're very welcome! 😃

@paescuj paescuj reopened this Sep 24, 2022
@paescuj paescuj closed this as completed Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants