Skip to content

Commit

Permalink
Merge pull request #6 from creative-commoners/pulls/main/action-ci
Browse files Browse the repository at this point in the history
NEW Add action-ci
  • Loading branch information
GuySartorelli authored Aug 15, 2023
2 parents 4095c3c + 68606f4 commit 6234119
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions funcs_scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ function is_module()
&& strpos($MODULE_DIR, '/webpack-config') === false;
}

/**
* Determine if the module being processed is a gha-* repository e.g. gha-ci
*
* Example usage:
* is_gha_repository()
*/
function is_gha_repository()
{
global $MODULE_DIR;
return strpos($MODULE_DIR, '/gha-') !== false;
}

/**
* Determine if the module being processed is one of the modules in a list
*
Expand Down
19 changes: 19 additions & 0 deletions scripts/cms-any/action-ci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

$ci = <<<EOT
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
ci:
name: CI
uses: silverstripe/gha-action-ci/.github/workflows/action-ci.yml@v1
EOT;

if (is_gha_repository()) {
write_file_even_if_exists('.github/workflows/action-ci.yml', $ci);
}

0 comments on commit 6234119

Please sign in to comment.