Using skip_commit/files except for PR?

Seddryck's Avatar

Seddryck

05 Aug, 2022 02:27 PM

Is it possible to use the the feature skip_commits (files) but exclude this settings for PR?

My use-case is the following:
- my appVeyor build agent is automatically generating some documentation (during the on_success) - If updated, this documentation is pushed to the git repository by the appVeyor build agent - I don't want that this push is restarting a new build so I'm excluding the repository where I push documentation in the skip_files - This is working for me except after a pull request. If the last commit was a documentation update the appVeyor build agent won't start.

I'd like to be able to start the appVeyor build agent on these cases (PR) because I want to protect my main branch and add checks on GitHub that the PR is successfully building (currently stuck because the build doesn't start).

skip_commits:
  files:
    - docs/
    - misc/
  1. Support Staff 1 Posted by Feodor Fitsner on 06 Aug, 2022 12:25 AM

    Feodor Fitsner's Avatar

    By "PR" do you mean "while you are working on the PR, i.e. build of a virtual PR commit" or "build of a PR merge commit into 'main' branch"?

  2. 2 Posted by Cédric Charlier on 06 Aug, 2022 11:02 AM

    Cédric Charlier's Avatar

    I guess, it's what you're defining a virtual PR commit.

    The problem can be seen on this pull request not working vs this one working.

    Here is the scenario for the PR not working

    1. I work on a dedicate feature branch and push some code
    2. The appVeyor build is started, build successful and the build is pushing some documentation updates back to git
    3. A second appVeyor build is not started because the push is on the directory docs/
    4. (steps 2 and 3 are executed twice)

    Until this point everything is working as I was expected.

    But then I create a pull request on GitHub. The main branch is protected so I won't be able to merge before the following three checks are successful:

    • GitGuardian (out-of-scope for this discussion)
    • A branch build
    • A PR build (I guess it's what you're naming a virtual commit)

    But the two builds are not starting because (I guess) the last commit is on the folder docs/ ... which is excluded by skip_commits. This is what I'm trying to workaround. I'd like that, at least, the PR build is starting. It's not a bug, I fully understand why appVeyor is taking the decision to not start the build, I'm just asking if there is a way to workaround this.

    When I forced the merge on the main branch with a rebase and squash, the squashed commit to the main branch was touching both the code and the docs/ folder, so no problem the build started.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac