Skip to content

Commit c19bc8b

Browse files
authored
Merge pull request #7 from scott45/js-todo
feat: second iteration of workflows improvements
2 parents d604427 + 310bf64 commit c19bc8b

11 files changed

Lines changed: 112 additions & 85 deletions

File tree

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name: Bug Report
2-
description: File a bug
3-
body:
4-
- type: textarea
5-
id: description
6-
attributes:
7-
label: Describe the bug
8-
placeholder: What went wrong?
9-
- type: dropdown
10-
id: labels
11-
attributes:
12-
label: Type
13-
options: [bug, enhancement]
14-
2+
description: File a bug
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Describe the bug
8+
placeholder: What went wrong?
9+
validations:
10+
required: true
11+
- type: dropdown
12+
id: labels
13+
attributes:
14+
label: Type
15+
options: [bug, enhancement]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Bug Report
3+
about: File a bug
4+
---
5+
## Bug Report
6+
**Describe the bug**:
7+
What went wrong?
8+
9+
**Type**:
10+
- [ ] Bug
11+
- [ ] Enhancement
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Development Item
2-
description: Propose a general development task or chore
3-
body:
4-
- type: textarea
5-
id: description
6-
attributes:
7-
label: Task Description
8-
placeholder: What needs to be done? (e.g., refactor code, update docs)
9-
validations:
10-
required: true
11-
- type: dropdown
12-
id: priority
13-
attributes:
14-
label: Priority
15-
options: [Low, Medium, High]
16-
default: Medium
17-
- type: dropdown
18-
id: labels
19-
attributes:
20-
label: Labels
21-
options: [chore, devops, documentation]
1+
name: Development Item
2+
description: Propose a general development task or chore
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Task Description
8+
placeholder: What needs to be done? (e.g., refactor code, update docs)
9+
validations:
10+
required: true
11+
- type: dropdown
12+
id: priority
13+
attributes:
14+
label: Priority
15+
options: [Low, Medium, High]
16+
default: 1
17+
- type: dropdown
18+
id: labels
19+
attributes:
20+
label: Labels
21+
options: [chore, devops, documentation]
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
name: Failing Test
2-
description: Report a failing automated test in the CI pipeline
3-
body:
4-
- type: textarea
5-
id: test-description
6-
attributes:
7-
label: Test Description
8-
placeholder: Which test is failing? (e.g., test name, file, or CI job)
9-
validations:
10-
required: true
11-
- type: textarea
12-
id: reproduction
13-
attributes:
14-
label: Steps to Reproduce
15-
placeholder: How can the failure be reproduced locally or in CI?
16-
- type: input
17-
id: ci-link
18-
attributes:
19-
label: CI Run Link
20-
placeholder: URL to the failing GitHub Actions run (if applicable)
21-
- type: dropdown
22-
id: labels
23-
attributes:
24-
label: Labels
25-
options: [bug, test-failure]
1+
name: Failing Test
2+
description: Report a failing automated test in the CI pipeline
3+
body:
4+
- type: textarea
5+
id: test-description
6+
attributes:
7+
label: Test Description
8+
placeholder: Which test is failing? (e.g., test name, file, or CI job)
9+
validations:
10+
required: true
11+
- type: textarea
12+
id: reproduction
13+
attributes:
14+
label: Steps to Reproduce
15+
placeholder: How can the failure be reproduced locally or in CI?
16+
- type: input
17+
id: ci-link
18+
attributes:
19+
label: CI Run Link
20+
placeholder: URL to the failing GitHub Actions run (if applicable)
21+
- type: dropdown
22+
id: labels
23+
attributes:
24+
label: Labels
25+
options: [bug, test-failure]
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: Feature Request
2-
description: Suggest a new feature for the project
3-
body:
4-
- type: textarea
5-
id: feature-description
6-
attributes:
7-
label: Feature Description
8-
placeholder: What feature would you like to see? (e.g., new API endpoint)
9-
validations:
10-
required: true
11-
- type: textarea
12-
id: use-case
13-
attributes:
14-
label: Use Case
15-
placeholder: How would this feature be used? Who benefits?
16-
- type: dropdown
17-
id: labels
18-
attributes:
19-
label: Labels
20-
options: [enhancement, feature]
1+
name: Feature Request
2+
description: Suggest a new feature for the project
3+
body:
4+
- type: textarea
5+
id: feature-description
6+
attributes:
7+
label: Feature Description
8+
placeholder: What feature would you like to see? (e.g., new API endpoint)
9+
validations:
10+
required: true
11+
- type: textarea
12+
id: use-case
13+
attributes:
14+
label: Use Case
15+
placeholder: How would this feature be used? Who benefits?
16+
- type: dropdown
17+
id: labels
18+
attributes:
19+
label: Labels
20+
options: [enhancement, feature]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## What Issue is being closed by this PR. Replace X below with the issue number
2+
Closes #X
3+
14
## What did we change?
25

36
## Why are we doing this?
@@ -6,5 +9,5 @@
69
- [ ] Locally
710
- [ ] Development Environment
811
- [ ] Not needed, changes very basic
9-
- [ ] Husky successfully run
12+
- [ ] npm i successfully run
1013
- [ ] Unit tests passing and Documentation done

.github/workflows/automate-docs.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [dev] # Trigger on PRs targeting dev
66
jobs:
77
update:
8+
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
89
runs-on: ubuntu-latest
910
steps:
1011
- uses: actions/checkout@v4
@@ -19,7 +20,7 @@ jobs:
1920
run: |
2021
mkdir -p wiki
2122
ISSUES=$(gh issue list --json title,createdAt --jq '.[] | "- \(.title) (Created: \(.createdAt))"' || echo "No issues found")
22-
echo "# Project Updates\n\n## Recent Issues\n$ISSUES" > wiki/Home.md
23+
echo -e "# Project Updates\n\n## Recent Issues\n$ISSUES" > wiki/Home.md
2324
git clone https://${{ github.actor }}:${{ secrets.DEMO_GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki-temp || (
2425
echo "Error: Wiki repo not found. Please initialize the wiki in the GitHub UI at https://github.com/${{ github.repository }}/wiki"
2526
exit 1
@@ -28,13 +29,19 @@ jobs:
2829
cd wiki-temp
2930
git config user.name "GitHub Actions"
3031
git config user.email "actions@github.com"
31-
git checkout dev || git checkout -b dev
32+
git checkout master || git checkout -b master
3233
git add .
3334
git commit -m "docs: auto-update wiki" || echo "No changes to commit"
34-
git push https://${{ github.actor }}:${{ secrets.DEMO_GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git dev
35+
git push https://${{ github.actor }}:${{ secrets.DEMO_GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git master
3536
- name: Auto-Update Project
3637
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev'
3738
run: |
3839
ISSUE_NUMBER=${{ github.event.pull_request.number }}
39-
ISSUE_ID=$(gh api graphql -f query="query { repository(owner: \"${{ github.repository_owner }}\", name: \"${{ github.repository_name }}\") { issue(number: $ISSUE_NUMBER) { id } } }" --jq '.data.repository.issue.id')
40-
gh api graphql -f query="mutation { updateProjectV2ItemFieldValue(input: { projectId: \"${{ secrets.PROJECT_ID }}\", itemId: \"$ISSUE_ID\", fieldId: \"${{ secrets.STATUS_FIELD_ID }}\", value: { singleSelectOptionId: \"${{ secrets.DONE_OPTION_ID }}\" } }) { projectV2Item { id } } }"
40+
PR_BODY=$(gh pr view $ISSUE_NUMBER --json body --jq '.body')
41+
LINKED_ISSUE_NUM=$(echo "$PR_BODY" | grep -oE 'Closes #([0-9]+)' | sed 's/Closes #//g' | head -n1)
42+
if [ -n "$LINKED_ISSUE_NUM" ]; then
43+
ISSUE_ID=$(gh api graphql -f query="query { repository(owner: \"${{ github.repository_owner }}\", name: \"${{ github.repository_name }}\") { issue(number: $LINKED_ISSUE_NUM) { id } } }" --jq '.data.repository.issue.id')
44+
gh api graphql -f query="mutation { updateProjectV2ItemFieldValue(input: { projectId: \"${{ secrets.PROJECT_ID }}\", itemId: \"$ISSUE_ID\", fieldId: \"${{ secrets.STATUS_FIELD_ID }}\", value: { singleSelectOptionId: \"${{ secrets.DONE_OPTION_ID }}\" } }) { projectV2Item { id } } }"
45+
else
46+
echo "No linked issue found in PR body (e.g., 'Closes #X'). Skipping project update."
47+
fi

.github/workflows/cd-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
workflow_dispatch:
88
jobs:
99
deploy:
10+
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4

.github/workflows/cd-main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
# tags: ['v*']
77
jobs:
88
deploy:
9+
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v4

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI Pipeline
22
on: [pull_request]
33
jobs:
44
test:
5+
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
56
runs-on: ubuntu-latest
67
steps:
78
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)