File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 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+ })
You can’t perform that action at this time.
0 commit comments