AL-Go icon indicating copy to clipboard operation
AL-Go copied to clipboard

Conditions to trigger pull request builds

Open dsaveyn opened this issue 11 months ago • 3 comments

The setting fullBuildPatterns allows us to configure when a full build is triggered. As far as I understand this does not apply for pull request builds.

Is there anything available to cover the following scenario?

We want a pull request build to be only triggered if an al,... file is changed. Changing a markdown file should for example trigger not a pr build.

I found this but I guess something like this is not natively supported for now?

dsaveyn avatar Mar 14 '24 12:03 dsaveyn

@dsaveyn Thank you for reaching out.

fullBuildPattern is actually exclusively used for pull request builds: changes to any path in the fullBuildPattern will trigger a full build. It means that all AL-Go projects will be built, regardless of whether they were changed in the PR or not.

Reading your scenario, it looks like you would want to set paths in the PullRequestHandler.yaml (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-paths). E.g.

name: 'Pull Request Build'

on:
  pull_request_target:
    paths: ['*.al']
...

However, this is currently not supported by AL-Go. Even if you change the workflow YAML, next time you run "Update AL-Go System Files" the changes will be overwritten.

The link that you mention is about the trigger type. AL-Go supports both pull_request_target or pull_request triggers (setting is called pullRequestTrigger). However, setting the trigger wouldn't solve your case. It is merely setting in what context the build would run.

mazhelez avatar Mar 15 '24 10:03 mazhelez

Thank you for the information. Any future plans to support this?

dsaveyn avatar Mar 15 '24 13:03 dsaveyn

No, not really.

But we will discuss if it's worth adding such functionality.

mazhelez avatar Mar 18 '24 07:03 mazhelez