skip-duplicate-actions icon indicating copy to clipboard operation
skip-duplicate-actions copied to clipboard

Skip concurrent not working

Open reinvanimschoot opened this issue 3 years ago • 8 comments

hi guys

I had a quick question.

We just started using this action to make sure we don't get double action runs when pushing and then creating a pull request. The config we have is the following:

    steps:
      - name: Check Duplicate Actions
        id: skip_check
        uses: fkirc/skip-duplicate-actions@master
        with:
          concurrent_skipping: 'same_content'
          
          ....

Our triggers for the actions are as follows:

on: [push, workflow_dispatch, pull_request]

Now, with this configuration, we still get a double run when pushing and the creating a pull request. In both logs, I see the following:

Run fkirc/skip-duplicate-actions@master
  with:
    concurrent_skipping: same_content
    github_token: ***
    paths_ignore: []
    paths: []
    cancel_others: true
    skip_after_successful_duplicate: true
    do_not_skip: ["workflow_dispatch", "schedule"]
Did not find other workflow-runs to be cancelled
Skip execution because the exact same files are concurrently checked in https://github.com/.../actions/runs/658092745

It's a bit confusing since it says it did not find any other workflows to cancel but it also says 'skip execution' which it then doesn't do.

Am I missing a part of the configuration? Are we doing something wrong?

Any help is appreciated! Cheers

reinvanimschoot avatar Mar 16 '21 15:03 reinvanimschoot

You are seeing this cancellation-message because you have cancel_others: true, which is the default-setting. Please note that cancellation and skipping are two completely different features.

To reduce this confusion, I am thinking about changing the default to cancel_others: false. After all, my belief is that cancellation does not fit for every project, and it also generates those annoying cancellation-mails from GitHub.

fkirc avatar Mar 16 '21 17:03 fkirc

So should I change my config in any way to make sure it only triggers one action when we have a push and pull_request running for the same branch?

reinvanimschoot avatar Mar 16 '21 17:03 reinvanimschoot

I believe that you need to add one more trigger to your do_not_skip-list (either push or pull_request). Otherwise, it might happen that both push and pull_request are skipped concurrently.

fkirc avatar Mar 16 '21 17:03 fkirc

hm, at the moment, both of them keep running. But I'll add one to the do_not_skip list and see if it helps! Thanks for the quick replies!

reinvanimschoot avatar Mar 16 '21 17:03 reinvanimschoot

If both of them are still running, then it seems that the should_skip-output is ignored. There are multiple ways to evaluate the should_skip-output, two ways are mentioned in Readme.

fkirc avatar Mar 16 '21 17:03 fkirc

I'm also getting issue with the duplicate skipping, I'm pretty much using example 1 and the step tells me Skip execution because another instance of the same workflow is already running in but the following step which has the if: ${{ needs.deduplication.outputs.should_skip != 'true' }} line isn't stopping it trigger.

Not really sure what to try to change to fix this.

benjamg avatar Jun 08 '21 16:06 benjamg

So, we saw a similar behavior to the OP's case, where two builds were both being skipped and cited each other as the cause, over on Hubris. It turned out to be the concurrent_skipping: 'same_content' setting. It seems like this setting is basically always a bad idea -- using same_content_newer fixes the issue.

cbiffle avatar Dec 03 '21 23:12 cbiffle

So, we saw a similar behavior to the OP's case, where two builds were both being skipped and cited each other as the cause, over on Hubris. It turned out to be the concurrent_skipping: 'same_content' setting. It seems like this setting is basically always a bad idea -- using same_content_newer fixes the issue.

same_content is primarily meant to be used in combination with do_not_skip, but I agree that same_content_newer might be a better standalone-option.

fkirc avatar Dec 04 '21 00:12 fkirc

Closing this due to inactivity...

(See also #250)

paescuj avatar Sep 22 '22 23:09 paescuj