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

[Question]: Skip initial commit CI/CD when creating repository from template #1425

Closed
navdotnetreqs opened this issue Jan 30, 2025 · 3 comments
Labels
question Further information is requested

Comments

@navdotnetreqs
Copy link

Question

Hi,

I create a new repository via a script using a template repository. The template repository has AL-Go set up.
The issue I'm facing is that when creating a new repository (from a template) the initial commit starts a CI/CD -pipeline.

This is very much unnecessary, it's a template repository, and the validations have been run when stuff's been merged to main. And now this pipeline gets run every single time a new repo is created from the template.

Best way to skip this Initial commit CI/CD?

@navdotnetreqs navdotnetreqs added the question Further information is requested label Jan 30, 2025
@aholstrup1
Copy link
Collaborator

You could cancel it through your script with GH Cli. Something like this:
gh run list --json databaseId --status in_progress | ConvertFrom-Json | ForEach-Object { gh run cancel $_.databaseId }

Not sure if we can do anything from AL-Go to prevent this. CI/CD runs on push by default in AL-Go.

@freddydk
Copy link
Contributor

Yeah, the initial commit is annoying - but it isn't one we control - GitHub kicks that one off.
Maybe we can make it faster at determining that there is nothing to build.

@navdotnetreqs
Copy link
Author

I created an organizational webhook that calls an azure function for every workflow. This azure function cancels the workflows if the payload ["workflow_run"]["display_title"] contains "Initial commit", using an http request to github's api. Not super elegant, works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants