Skip to content

Commit ae39bff

Browse files
committed
Add GitHub workspace configuration and issue type workflow
1 parent 810aae3 commit ae39bff

File tree

4 files changed

+114
-1
lines changed

4 files changed

+114
-1
lines changed

.github.code-workspace

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
},
6+
{
7+
"path": "../../scripts"
8+
}
9+
],
10+
"settings": {
11+
"chat.mcp.access": "all",
12+
"github.copilot.chat.virtualTools.threshold": 128,
13+
"git.confirmSync": true,
14+
"github.copilot.enable": {
15+
"*": true,
16+
"php": true,
17+
"javascript": true,
18+
"css": true,
19+
"scss": true,
20+
"json": true,
21+
"yaml": true,
22+
"python": false,
23+
"plaintext": false,
24+
"markdown": true
25+
},
26+
"chat.modeFilesLocations": {
27+
"**/.github/chatmodes": true,
28+
"chatmodes": true
29+
},
30+
"chat.promptFilesLocations": {
31+
"**/.github/prompts": true,
32+
"prompts": true
33+
},
34+
"chat.instructionsFilesLocations": {
35+
"**/.github/instructions": true,
36+
"instructions": true
37+
},
38+
"files.associations": {
39+
"*.chatmode.md": "markdown",
40+
"*.instructions.md": "markdown",
41+
"*.agent.md": "markdown",
42+
"*.prompt.md": "markdown",
43+
"*inline-documentation.instructions.md": "markdown",
44+
"*.theme.json": "jsonc",
45+
"theme.json": "jsonc"
46+
},
47+
"emmet.includeLanguages": {
48+
"php": "html"
49+
},
50+
"php.suggest.basic": false
51+
}
52+
}

.github/labels.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@
251251
- name: meta:stale
252252
color: 9198A1
253253
description: Marked as stale
254+
- name: meta:needs-changelog
255+
color: E1E4E8
256+
description: Requires a changelog entry before merge
254257

255258
# AI-Ops
256259
- name: ai-ops:instructions

.github/workflows/issue-type.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Apply Issue Type
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
7+
jobs:
8+
set-issue-type:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write # Necessary permission for the job
12+
13+
steps:
14+
- name: Generate token
15+
id: generate_token
16+
uses: tibdex/github-app-token@v2
17+
with:
18+
app_id: ${{ secrets.APP_ID }}
19+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
20+
21+
- name: Determine and apply issue type
22+
uses: actions/github-script@v7
23+
with:
24+
github-token: ${{ steps.generate_token.outputs.token }}
25+
script: |
26+
const issue_title = context.payload.issue.title.toLowerCase();
27+
let issue_type_name = null;
28+
29+
if (issue_title.startsWith('bug:')) {
30+
issue_type_name = 'bug';
31+
} else if (issue_title.startsWith('feature:')) {
32+
issue_type_name = 'feature';
33+
} else if (issue_title.startsWith('task:')) {
34+
issue_type_name = 'task';
35+
} else {
36+
console.log('No matching prefix found. Skipping issue type application.');
37+
return;
38+
}
39+
40+
// Fetch all available issue types for the organization
41+
const { data: orgIssueTypes } = await github.request('GET /orgs/{org}/issue_types', {
42+
org: context.repo.owner,
43+
});
44+
45+
// Find the ID for the target issue type
46+
const targetIssueType = orgIssueTypes.find(type => type.name.toLowerCase() === issue_type_name);
47+
48+
if (targetIssueType) {
49+
await github.request('PATCH /repos/{owner}/{repo}/issues/{issue_number}', {
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.payload.issue.number,
53+
issue_type: targetIssueType.id,
54+
});
55+
console.log(`Successfully set issue type to "${issue_type_name}".`);
56+
} else {
57+
console.log(`Issue type "${issue_type_name}" not found in organization settings.`);
58+
}

.github/workflows/project-meta-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
pull-requests: read
1313

1414
env:
15-
PROJECT_URL: ${{ vars.LS_PROJECT_URL }} # e.g. https://github.com/orgs/LightSpeed/projects/1
15+
PROJECT_URL: ${{ vars.LS_PROJECT_URL }} # e.g. https://github.com/orgs/lightspeedwp/projects/1
1616

1717
jobs:
1818
add-and-sync:

0 commit comments

Comments
 (0)