Skip to content

Commit

Permalink
Test sub-split closer on AwsS3V3
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Jul 3, 2022
1 parent 1c32f2a commit 1e9ca10
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bin/close-subsplit-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Close sub-split PRs

on:
schedule:
- cron: '30 7 * * *'

jobs:
close_subsplit_prs:
runs-on: ubuntu-latest
name: Close sub-split PRs
steps:
- uses: frankdejonge/[email protected]
with:
close_pr: 'no'
target_branch_match: '^(?!master).+$'
message: |
Hi :wave:,
Thank you for contributing to Flysystem. Unfortunately, you've sent a PR to a read-only sub-split repository.
All pull requests should be directed towards: https://github.com/thephpleague/flsysystem
19 changes: 19 additions & 0 deletions bin/update-subsplit-closers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;

include __DIR__ . '/../vendor/autoload.php';

$filesystem = new Filesystem(new LocalFilesystemAdapter(realpath(__DIR__ . '/../')));
$subsplits = json_decode($filesystem->read('config.subsplit-publish.json'), true);
$workflowContents = $filesystem->read('bin/close-subsplit-prs.yml');

foreach ($subsplits['sub-splits'] as ['directory' => $subsplit]) {
if ($subsplit !== 'src/AwsS3V3') {
continue;
}

$workflowPath = $subsplit . '/.github/workflows/close-subsplit-prs.yaml';
$filesystem->write($workflowPath, $workflowContents);
}
22 changes: 22 additions & 0 deletions src/AwsS3V3/.github/workflows/close-subsplit-prs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Close sub-split PRs

on:
schedule:
- cron: '30 7 * * *'

jobs:
close_subsplit_prs:
runs-on: ubuntu-latest
name: Close sub-split PRs
steps:
- uses: frankdejonge/[email protected]
with:
close_pr: 'no'
target_branch_match: '^(?!master).+$'
message: |
Hi :wave:,
Thank you for contributing to Flysystem. Unfortunately, you've sent a PR to a read-only sub-split repository.
All pull requests should be directed towards: https://github.com/thephpleague/flsysystem

0 comments on commit 1e9ca10

Please sign in to comment.