Merge branch 'close-stale-issues-prs' of https://github.com/peaklabs-dev/coolify into close-stale-issues-prs
This commit is contained in:
14
.github/pull_request_template.md
vendored
14
.github/pull_request_template.md
vendored
@@ -1 +1,13 @@
|
||||
> Always use `next` branch as destination branch for PRs, not `main`
|
||||
## Submit Checklist (REMOVE THIS SECTION BEFORE SUBMITTING)
|
||||
- [ ] I have selected the `next` branch as the destination for my PR, not `main`.
|
||||
- [ ] I have listed all changes in the `Changes` section.
|
||||
- [ ] I have filled out the `Issues` section with the issue/discussion link(s) (if applicable).
|
||||
- [ ] I have tested my changes.
|
||||
- [ ] I have considered backwards compatibility.
|
||||
- [ ] I have removed this checklist and any unused sections.
|
||||
|
||||
## Changes
|
||||
-
|
||||
|
||||
## Issues
|
||||
- fix #
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
|
||||
|
||||
async function processIssue(issueNumber) {
|
||||
try {
|
||||
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
|
||||
@@ -65,11 +65,14 @@ jobs:
|
||||
}
|
||||
|
||||
if (context.eventName === 'pull_request' || context.eventName === 'pull_request_target') {
|
||||
const { data: closedIssues } = await github.rest.search.issuesAndPullRequests({
|
||||
q: `repo:${owner}/${repo} is:issue is:closed linked:${context.payload.pull_request.number}`,
|
||||
per_page: 100
|
||||
});
|
||||
for (const issue of closedIssues.items) {
|
||||
await processIssue(issue.number);
|
||||
const pr = context.payload.pull_request;
|
||||
if (pr.body) {
|
||||
const issueReferences = pr.body.match(/#(\d+)/g);
|
||||
if (issueReferences) {
|
||||
for (const reference of issueReferences) {
|
||||
const issueNumber = parseInt(reference.substring(1));
|
||||
await processIssue(issueNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user