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 13, 2024
1 parent da766e5 commit 8ffd9b0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/cms-any/add-prs-to-project.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

$content = <<<EOT
name: Add new pull requests to a github project
on:
pull_request:
types:
- opened
- ready_for_review
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 github 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 8ffd9b0

Please sign in to comment.