Skip to content

Commit 84188fc

Browse files
committed
feat: Add Branch Update Reminder as PR Comment
1 parent c33a130 commit 84188fc

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/lint.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint Check
1+
name: Lint Check laravel-PWA
22

33
on:
44
push:
@@ -97,3 +97,32 @@ jobs:
9797
repo: context.repo.repo,
9898
body: output
9999
})
100+
101+
- name: Alert for Forked Repositories
102+
if: github.event.pull_request.head.repo.fork == true
103+
uses: actions/github-script@v6
104+
with:
105+
github-token: ${{ secrets.GITHUB_TOKEN }}
106+
script: |
107+
const output = `
108+
## ⚠️ This PR is from a Forked Repository
109+
110+
Your branch is from a **forked repository**, and it might be outdated compared to the \`main\` branch.
111+
112+
Please make sure you have the latest updates from \`main\` before merging.
113+
114+
Run the following commands:
115+
\`\`\`sh
116+
git remote add upstream https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git
117+
git fetch upstream
118+
git merge upstream/main
119+
git push origin HEAD
120+
\`\`\`
121+
`;
122+
123+
github.rest.issues.createComment({
124+
issue_number: context.issue.number,
125+
owner: context.repo.owner,
126+
repo: context.repo.repo,
127+
body: output
128+
})

0 commit comments

Comments
 (0)