Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fd63ff8
feat: initialize TODO API with Express
scott45 Oct 15, 2025
fceaf17
chore: use secrets for project automation IDs
scott45 Oct 16, 2025
9cb7c6c
chore: add other files in the .github folder and the DOCKERFILE
scott45 Oct 16, 2025
9ed98dc
chore: minor improvements in the workflows
scott45 Oct 16, 2025
05aeb32
chore: fix syntax errors in workflow files
scott45 Oct 16, 2025
0fb5c03
fix: add wiki dir creation and robust wiki push and update to correct…
scott45 Oct 16, 2025
253a7fe
fix: run npm install
scott45 Oct 16, 2025
4c6100c
fix: conventional commit
scott45 Oct 16, 2025
5055496
fix: correct wiki URL and git identity issues
scott45 Oct 16, 2025
0518634
fix: correct wiki repo URL and remove invalid init logic
scott45 Oct 16, 2025
fbb7442
fix: use github.repository for wiki URL and add auth for git
scott45 Oct 16, 2025
90ae4db
fix: use master for wiki push and trigger on dev PRs
scott45 Oct 16, 2025
d604427
Merge pull request #4 from scott45/js-todo
scott45 Oct 16, 2025
e91065c
feat: second iteration of workflows improvements
scott45 Oct 16, 2025
310bf64
fix: correct wiki formatting with echo -e and overwrite
scott45 Oct 16, 2025
c19bc8b
Merge pull request #7 from scott45/js-todo
scott45 Oct 16, 2025
9372b07
enhance: subdivide wiki issues into To-Do and Done
scott45 Oct 16, 2025
ebf29c8
Merge pull request #9 from scott45/js-todo
scott45 Oct 16, 2025
fb97a5f
enhance: dynamic tag with PR number and commit hash for dev and fix b…
scott45 Oct 16, 2025
4f3f1f1
Merge pull request #11 from scott45/js-todo
scott45 Oct 16, 2025
c228a0d
fix: stabilize wiki workflow with forced commits
scott45 Oct 16, 2025
c56fb9e
fix: stabilize wiki workflow by running only on opened issues
scott45 Oct 16, 2025
09192ce
Merge pull request #12 from scott45/js-todo
scott45 Oct 16, 2025
cbb6b85
fix: stabilize wiki workflow by running only on pr merges
scott45 Oct 16, 2025
74b4b53
Merge pull request #13 from scott45/js-todo
scott45 Oct 16, 2025
b828157
fix: stabilize wiki workflow by running also on pr merges
scott45 Oct 16, 2025
99aeeb6
fix: stabilize wiki workflow by running also on pr merges
scott45 Oct 16, 2025
04a87b6
feat: list issues and pr merges in wiki
scott45 Oct 17, 2025
60c898a
Merge pull request #14 from scott45/js-todo
scott45 Oct 17, 2025
2d2f3ed
enhance: add subheadings for PRs in wiki
scott45 Oct 17, 2025
057a3f1
Merge pull request #16 from scott45/js-todo
scott45 Oct 17, 2025
15791f6
fix: add issues trigger and confirm subheadings
scott45 Oct 17, 2025
56f22cf
fix: revert to last working version
scott45 Oct 17, 2025
575b53d
Merge pull request #18 from scott45/js-todo
scott45 Oct 17, 2025
5e2a230
fix: only trigger workflow on issues
scott45 Oct 17, 2025
7423973
fix: only trigger workflow on issues
scott45 Oct 17, 2025
51cb937
Merge pull request #22 from scott45/js-todo
scott45 Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@scott45
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Bug Report yml
description: File a bug with yml
body:
- type: textarea
id: description
attributes:
label: Describe the bug
placeholder: What went wrong?
validations:
required: true
- type: dropdown
id: labels
attributes:
label: Type
options: [bug, enhancement]
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Bug Report with traditional mkdwn format
about: File a bug in mkdwn
---
## Bug Report
**Describe the bug**:
What went wrong?

**Type**:
- [ ] Bug
- [ ] Enhancement
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/development-item.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Development Item
description: Propose a general development task or chore
body:
- type: textarea
id: description
attributes:
label: Task Description
placeholder: What needs to be done? (e.g., refactor code, update docs)
validations:
required: true
- type: dropdown
id: priority
attributes:
label: Priority
options: [Low, Medium, High]
default: 1
- type: dropdown
id: labels
attributes:
label: Labels
options: [chore, devops, documentation]
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/failing-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Failing Test
description: Report a failing automated test in the CI pipeline
body:
- type: textarea
id: test-description
attributes:
label: Test Description
placeholder: Which test is failing? (e.g., test name, file, or CI job)
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to Reproduce
placeholder: How can the failure be reproduced locally or in CI?
- type: input
id: ci-link
attributes:
label: CI Run Link
placeholder: URL to the failing GitHub Actions run (if applicable)
- type: dropdown
id: labels
attributes:
label: Labels
options: [bug, test-failure]
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Feature Request
description: Suggest a new feature for the project
body:
- type: textarea
id: feature-description
attributes:
label: Feature Description
placeholder: What feature would you like to see? (e.g., new API endpoint)
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use Case
placeholder: How would this feature be used? Who benefits?
- type: dropdown
id: labels
attributes:
label: Labels
options: [enhancement, feature]
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## What Issue is being closed by this PR. Replace X below with the issue number
Closes #X

## What did we change?

## Why are we doing this?

## How was it tested?
- [ ] Locally
- [ ] Development Environment
- [ ] Not needed, changes very basic
- [ ] npm i successfully run
- [ ] Unit tests passing and Documentation done
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

# Set update schedule for GitHub Actions

version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
50 changes: 50 additions & 0 deletions .github/workflows/automate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Auto-Update Wiki & Project
on:
issues:
types: [opened, closed] # [opened, edited, closed, reopened]
jobs:
update:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install GH CLI
run: |
sudo apt update && sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list
sudo apt update && sudo apt install gh -y
gh auth login --with-token <<< ${{ secrets.DEMO_GITHUB_TOKEN }}
- name: Auto-Update Wiki
run: |
mkdir -p wiki
# Get open issues
ISSUES_OPEN=$(gh issue list --state open --json title,createdAt --jq '.[] | "- \(.title) (Created: \(.createdAt))"' || echo "No open issues")
# Get closed issues
ISSUES_CLOSED=$(gh issue list --state closed --json title,createdAt --jq '.[] | "- \(.title) (Created: \(.createdAt))"' || echo "No closed issues")
# Generate Markdown with subsections
echo -e "# Project Updates\n\n## To-Do\n$ISSUES_OPEN\n\n## Done\n$ISSUES_CLOSED" > wiki/Home.md
git clone https://${{ github.actor }}:${{ secrets.DEMO_GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki-temp || (
echo "Error: Wiki repo not found. Please initialize the wiki in the GitHub UI at https://github.com/${{ github.repository }}/wiki"
exit 1
)
cp wiki/Home.md wiki-temp/
cd wiki-temp
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git checkout master || git checkout -b master
git add .
git commit -m "docs: auto-update wiki" || git commit -m "docs: force update wiki"
git push https://${{ github.actor }}:${{ secrets.DEMO_GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git master
- name: Auto-Update Project
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev'
run: |
ISSUE_NUMBER=${{ github.event.pull_request.number }}
PR_BODY=$(gh pr view $ISSUE_NUMBER --json body --jq '.body')
LINKED_ISSUE_NUM=$(echo "$PR_BODY" | grep -oE 'Closes #([0-9]+)' | sed 's/Closes #//g' | head -n1)
if [ -n "$LINKED_ISSUE_NUM" ]; then
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')
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 } } }"
else
echo "No linked issue found in PR body (e.g., 'Closes #X'). Skipping project update."
fi
31 changes: 31 additions & 0 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to GHCR (Dev)
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
deploy:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- name: Publish to GH Packages (Docker)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DEMO_GITHUB_TOKEN }}
- run: |
# Extract PR number from merge commit message (e.g., "Merge pull request #5...")
PR_NUMBER=$(git log -1 --pretty=%B | grep -oE 'Merge pull request #([0-9]+)' | sed 's/Merge pull request #//g' || echo "unknown")
# Use short commit hash (first 7 chars)
COMMIT_HASH=$(git rev-parse --short=7 HEAD)
# Construct tag (e.g., pr5-a1b2c3d)
TAG="pr${PR_NUMBER}-${COMMIT_HASH}"
# Build and push with dynamic tag
docker build -t ghcr.io/${{ github.repository }}:$TAG .
docker push ghcr.io/${{ github.repository }}:$TAG
24 changes: 24 additions & 0 deletions .github/workflows/cd-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy to GHCR (Main)
on:
push:
branches:
- main
# tags: ['v*']
jobs:
deploy:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- name: Publish to GH Packages (Docker)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DEMO_GITHUB_TOKEN }}
- run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI Pipeline
on: [pull_request]
jobs:
test:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm test
env:
GITHUB_TOKEN: ${{ secrets.DEMO_GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Prepare Release
on:
push:
branches:
- main
jobs:
release:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for last tag and notes
- name: Install GH CLI
run: |
sudo apt update && sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list
sudo apt update && sudo apt install gh -y
gh auth login --with-token <<< ${{ secrets.DEMO_GITHUB_TOKEN }}
- name: Generate Release Notes and Tag
run: |
# Get last tag or default to v1.0.0
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v1.0.0")
# Extract PR title from merge commit message (e.g., "Merge pull request #X from ... feat!: release v1.0.0")
PR_TITLE=$(git log -1 --merges --pretty=%s | sed 's/Merge pull request #[0-9]\+ from .*//;s/ .*//')
# Determine version bump based on PR title prefix
MAJOR=$(echo "$PR_TITLE" | grep -q "^feat!:" && echo 1 || echo 0)
MINOR=$(echo "$PR_TITLE" | grep -q "^\(feat:\|fix:\|refactor:\)" && echo 1 || echo 0)
PATCH=$(echo "$PR_TITLE" | grep -q "^\(chore:\|docs:\|test:\)" && echo 1 || echo 0)
# Parse current version
CURRENT_MAJOR=$(echo $LAST_TAG | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/\1/')
CURRENT_MINOR=$(echo $LAST_TAG | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/\2/')
CURRENT_PATCH=$(echo $LAST_TAG | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)/\3/')
# Calculate new version (only one level bumps)
NEW_MAJOR=$((CURRENT_MAJOR + MAJOR))
NEW_MINOR=$((CURRENT_MINOR + MINOR * (1 - MAJOR)))
NEW_PATCH=$((CURRENT_PATCH + PATCH * (1 - MAJOR) * (1 - MINOR)))
TAG="v${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}"
# Extract notes from commits since last tag
NOTES=$(git log $LAST_TAG..HEAD --pretty=format:"- %s" | grep -E "^(feat|fix|chore|docs|test|refactor):" || echo "Initial release")
# Create tag and draft release
git tag $TAG
git push origin $TAG
gh release create $TAG --title "Release ${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}" --notes "$NOTES" --draft
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY src/ ./src/
EXPOSE 3000
CMD ["npm", "start"]
# Add these labels for auto-linking
LABEL org.opencontainers.image.source="https://github.com/scott45/github-devops-javascript"
Loading