-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW Add script for new action that adds PRs to project (#59)
- Loading branch information
1 parent
e33d114
commit c8b89ea
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |