-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (39 loc) · 1.07 KB
/
99-auto-update-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
name: Auto Update PR
on:
workflow_call:
inputs:
head:
required: true
type: string
base:
required: true
type: string
permissions:
pull-requests: write
contents: write
jobs:
create-pull-request:
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ↔ Create Pull Request
uses: actions/github-script@v7
id: create-pr
with:
result-encoding: string
script: |
const script = require('./.github/scripts/auto-update-pr.js')
const head = '${{ inputs.head }}';
const base = '${{ inputs.base }}';
return await script({github, context}, head, base)
- name: 🤖 Enable auto-merge for auto-update
run: |
if [[ $PR_URL != false ]];
then
gh pr merge --auto --merge "$PR_URL"
fi
env:
PR_URL: ${{steps.create-pr.outputs.result}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}