Added Monorepo Merge Notice Workflow

This workflow leaves a comment and closes any pull requests
or issues that have been opened in
the repository.
This commit is contained in:
Christopher Allford 2023-12-08 11:28:03 -08:00
parent 417683095a
commit 3683c1486c
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
name: 'Monorepo Merge Notices'
on:
pull_request:
types: [ 'opened' ]
issues:
types: [ 'opened' ]
jobs:
issue_block:
name: 'Block Issues & Pull Requests'
runs-on: 'ubuntu-latest'
steps:
- name: 'Add Merge Notice'
uses: 'actions/github-script@v5'
with:
script: |
github.rest.issues.createComment( {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'We have merged WooCommerce Blocks into the WooCommerce monorepo. Please open any issues or pull requests \
in the woocommerce/woocommerce repository.'
} );
- name: 'Close'
uses: 'actions/github-script@v5'
with:
script: |
octokit.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
});