-
Notifications
You must be signed in to change notification settings - Fork 8
102 lines (76 loc) · 3.63 KB
/
issue-form-submission.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Comment on Issue
on:
issues:
types:
- opened
jobs:
comment-on-issue:
runs-on: ubuntu-latest
steps:
- name: Comment on Issue
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.issue.number;
const labels = context.payload.issue.labels.map(label => label.name);
const isBugRequest = labels.includes('bug');
const isFeatureRequest = labels.includes('enhancement');
const defaultBranch = "nextjs"
if (isBugRequest) {
const branchName = `bug-${issueNumber}`;
const branchSetupInstructions = `
Hello @${{ github.actor }}! Thank you for submitting the 🐞Bug Request Form. We appreciate your contribution. :wave:
We will look into it and provide a response as soon as possible.
To work on this bug request, you can follow these branch setup instructions:
1. Checkout the main branch:
\`\`\`
git checkout ${defaultBranch}
\`\`\`
2. Pull the latest changes from the remote main branch:
\`\`\`
git pull origin ${defaultBranch}
\`\`\`
3. Create a new branch specific to this bug request using the issue number:
\`\`\`
git checkout -b ${branchName}
\`\`\`
Feel free to make the necessary changes in this branch and submit a pull request when you're ready.
Best regards,
Deep Learning Playground (DLP) Team
`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: branchSetupInstructions
});
} else if (isFeatureRequest) {
const branchName = `feature-${issueNumber}`;
const branchSetupInstructions = `
Hello @${{ github.actor }}! Thank you for submitting the Feature Request Form. We appreciate your contribution. :wave:
We will look into it and provide a response as soon as possible.
To work on this feature request, you can follow these branch setup instructions:
1. Checkout the main branch:
\`\`\`
git checkout ${defaultBranch}
\`\`\`
2. Pull the latest changes from the remote main branch:
\`\`\`
git pull origin ${defaultBranch}
\`\`\`
3. Create a new branch specific to this feature request using the issue number:
\`\`\`
git checkout -b ${branchName}
\`\`\`
Feel free to make the necessary changes in this branch and submit a pull request when you're ready.
Best regards,
Deep Learning Playground (DLP) Team
`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: branchSetupInstructions
});
}