Skip to content

Commit b291fd2

Browse files
committed
2 parents 3ee3b3e + d7636fc commit b291fd2

File tree

3 files changed

+82
-5
lines changed

3 files changed

+82
-5
lines changed

.github/workflows/pr.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: 🔃 Create PRs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
dry-run:
6+
description: 'Run the workflow without creating PRs'
7+
required: false
8+
default: false
9+
type: boolean
10+
schedule:
11+
- cron: '0 0 * * *'
12+
jobs:
13+
get-branches:
14+
outputs:
15+
branches: ${{ steps.get-branches.outputs.branches }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Get branches
23+
id: get-branches
24+
shell: pwsh
25+
run: |
26+
$branches = git branch -r --format="%(refname:short)" | ForEach-Object { $_.Trim() -replace "^origin/", "" }
27+
# filter only branches that start with dev/
28+
$branches = $branches | Where-Object { $_ -match "^dev/" }
29+
$branchJson = ConvertTo-Json @($branches) -Compress
30+
Write-Host "branches=$branchJson"
31+
echo "branches=$branchJson" >> $env:GITHUB_OUTPUT
32+
create-pr:
33+
needs: get-branches
34+
strategy:
35+
max-parallel: 1
36+
matrix:
37+
branch: ${{fromJson(needs.get-branches.outputs.branches)}}
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
- name: Set Env
45+
run: |
46+
TARGET=$(echo ${{ matrix.branch }} | sed 's/dev\///')
47+
SOURCE=${{ matrix.branch }}
48+
49+
if [ -z "$TARGET" ]; then
50+
echo "TARGET is empty"
51+
exit 1
52+
fi
53+
54+
if [ -z "$SOURCE" ]; then
55+
echo "SOURCE is empty"
56+
exit 1
57+
fi
58+
59+
if [ "$SOURCE" == "$TARGET" ]; then
60+
echo "SOURCE is the same as TARGET"
61+
exit 1
62+
fi
63+
64+
echo "SOURCE=$SOURCE"
65+
echo "TARGET=$TARGET"
66+
echo "SOURCE=$SOURCE" >> $GITHUB_ENV
67+
echo "TARGET=$TARGET" >> $GITHUB_ENV
68+
- name: Run the Action
69+
if: ${{ github.event.inputs.dry-run == 'false' }}
70+
uses: devops-infra/[email protected]
71+
with:
72+
github_token: ${{ secrets.GITHUB_TOKEN }}
73+
source_branch: ${{ env.SOURCE }}
74+
target_branch: ${{ env.TARGET }}
75+
title: "Merge ${{ env.SOURCE }} into ${{ env.TARGET }}"
76+
reviewer: ${{ github.repository_owner }}
77+
assignee: ${{ github.repository_owner }}

src/jcdcdev.Umbraco.ExtendedMarkdownEditor.Client/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jcdcdev.Umbraco.ExtendedMarkdownEditor.Client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"devDependencies": {
1515
"@umbraco-cms/backoffice": "^14.0.0",
1616
"typescript": "^5.4.5",
17-
"vite": "^5.2.12"
17+
"vite": "^5.2.14"
1818
},
1919
"volta": {
2020
"node": "21.7.3"

0 commit comments

Comments
 (0)