Skip to content

Commit

Permalink
NEW Add script for new action that adds PRs to project (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jun 14, 2024
1 parent e33d114 commit c8b89ea
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:
addprtoproject:
# 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 c8b89ea

Please sign in to comment.