Skip to content

Commit

Permalink
Merge pull request #26 from josh-wong/add-auto-pr-workflows
Browse files Browse the repository at this point in the history
Issue fix: Add workflows that auto-create PRs
  • Loading branch information
josh-wong authored May 18, 2024
2 parents 90f158d + ebc6a10 commit 3468bf8
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow auto-creates PRs for docs that have been updated in my "bitcoin-cash-node-on-raspberry-pi" repository.
name: ✨ Auto-create PR - bitcoin-cash-node-on-raspberry-pi docs

on:
push:
branches:
- bitcoin-cash-node-on-raspberry-pi/**
- passgen/**
- zune-software-setup/**

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Create pull request
uses: actions/github-script@v7
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'AUTO: Docs sync - `bitcoin-cash-node-on-raspberry-pi`',
owner,
repo,
head: '${{ github.ref_name }}',
base: 'main',
body: [
'This is an automated pull request (PR) to sync changes to docs in the [josh-wong/bitcoin-cash-node-on-raspberry-pi](https://github.com/josh-wong/bitcoin-cash-node-on-raspberry-pi) repo to this repo.',
'',
'Before merging this PR, confirm the following:',
'',
'- [ ] I have updated the side navigation to include new docs or remove deleted docs (if necessary).',
'- [ ] I have confirmed that this PR can be merged without waiting (if necessary).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['documentation', 'triage']
});
38 changes: 38 additions & 0 deletions .github/workflows/auto-create-pr-passgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow auto-creates PRs for docs that have been updated in my "passgen" repository.
name: ✨ Auto-create PR - passgen docs

on:
push:
branches:
- passgen/**

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Create pull request
uses: actions/github-script@v7
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'AUTO: Docs sync - `passgen`',
owner,
repo,
head: '${{ github.ref_name }}',
base: 'main',
body: [
'This is an automated pull request (PR) to sync changes to docs in the [josh-wong/passgen](https://github.com/josh-wong/passgen) repo to this repo.',
'',
'Before merging this PR, confirm the following:',
'',
'- [ ] I have updated the side navigation to include new docs or remove deleted docs (if necessary).',
'- [ ] I have confirmed that this PR can be merged without waiting (if necessary).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['documentation', 'triage']
});
38 changes: 38 additions & 0 deletions .github/workflows/auto-create-pr-zune-software-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow auto-creates PRs for docs that have been updated in my "zune-software-setup" repository.
name: ✨ Auto-create PR - zune-software-setup docs

on:
push:
branches:
- zune-software-setup/**

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Create pull request
uses: actions/github-script@v7
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'AUTO: Docs sync - `zune-software-setup`',
owner,
repo,
head: '${{ github.ref_name }}',
base: 'main',
body: [
'This is an automated pull request (PR) to sync changes to docs in the [josh-wong/zune-software-setup](https://github.com/josh-wong/zune-software-setup) repo to this repo.',
'',
'Before merging this PR, confirm the following:',
'',
'- [ ] I have updated the side navigation to include new docs or remove deleted docs (if necessary).',
'- [ ] I have confirmed that this PR can be merged without waiting (if necessary).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['documentation', 'triage']
});

0 comments on commit 3468bf8

Please sign in to comment.