AL-Go
AL-Go copied to clipboard
[Bug]: CICDPullRequestBranches break PullRequestHandler.yaml
AL-Go version
8.0
Describe the issue
I added these to my .github/AL-Go-settings.json
"CICDPushBranches": [], "CICDPullRequestBranches": [],
Then I ran Update-AL-Go System files.
For CI/CD.yaml
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- '.github/workflows/*.yaml'
- '!.github/workflows/CICD.yaml'
branches: [ 'main', 'release/*', 'feature/*' ]
became
on:
workflow_dispatch:
But for PullRequestHandler.yaml
on:
pull_request_target:
branches: [ 'main' ]
became:
on:
pull_request_target:
branches: [ '' ]
and that breaks the yaml.
Expected behavior
Should remove the target branches properly.
Steps to reproduce
As above.
Additional context (logs, screenshots, etc.)
No response
Hi @navdotnetreqs and thank you for reporting this issue!
Can you please clarify what you mean by "that breaks the yaml"? The generated YAML code seems valid to me.
If your wish is to not use pull requests at all, you can unusedALGoSystemFiles setting instead.
Hi @mazhelez ,
Sorry, I could have given more details!
With that yaml the github workflow fails:
Check failure on line 1 in .github/workflows/PullRequestHandler.yaml
GitHub Actions
/ .github/workflows/PullRequestHandler.yaml
Invalid workflow file
(Line: 5, Col: 17): Unexpected value ''
Hi again @navdotnetreqs
I see now what the issue is.
Can you elaborate a bit what you want to achieve by setting CICDPullRequestBranches to []?
If you don't want to use PRs, you can disable the workflow or add its file (PullRequestHandler.yaml) to unusedALGoSystemFiles (so the file itself will be removed from the repo).
Alternatively, you can also set CICDPullRequestBranches to [ 'non-existent-branch']. That way, the workflow will be there, but it will never be triggered.