forked from enthec/webappanalyzer
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (40 loc) · 1.22 KB
/
fork_pull_request.yaml
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
45
46
name: Sync Fork
on:
schedule:
- cron: '0 1 * * 1' # Runs every Monday at 1 AM
workflow_dispatch: # on button click
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Check for existing PR
id: check_pr
uses: actions/github-script@v7
with:
script: |
const { data: prs } = await github.rest.pulls.list({
owner: 'offensity',
repo: 'webappanalyzer',
head: 'enthec:main',
base: 'main',
state: 'open',
});
if (prs.length > 0) {
return prs[0].html_url; // Return the URL of the existing PR
}
return ''; // No open PR found
result-encoding: string
- name: Sync Fork
if: steps.check_pr.outputs.result == '' # Only run if no PR exists
uses: tgymnich/[email protected]
with:
owner: enthec
repo: webappanalyzer
base: main
head: main
auto_merge: false
merge_method: rebase
pr_title: "feat: Update from origin"
- name: Skip if PR exists
if: steps.check_pr.outputs.result != ''
run: echo "PR already exists, skipping sync."