Skip to content

Commit

Permalink
NEW Add script for new action that adds PRs to project
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jun 12, 2024
1 parent da766e5 commit deddd5b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/cms-any/add-prs-to-project.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

$content = <<<EOT
name: Add new pull request to project
on:
pull_request:
types:
- opened
permissions: {}
jobs:
add-pr-to-project:
# Only run on the silverstripe account
if: github.repository_owner == 'silverstripe'
runs-on: ubuntu-latest
steps:
- name: Add PR to project
uses: silverstripe/add-pr-to-project@v1
EOT;

$actionPath = '.github/workflows/add-prs-to-project.yml';
$shouldHaveAction = module_account() === 'silverstripe' && is_module() && !module_is_recipe();

if ($shouldHaveAction) {
write_file_even_if_exists($actionPath, $content);
} else {
delete_file_if_exists($actionPath);
}

0 comments on commit deddd5b

Please sign in to comment.