Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 3 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Build

on:
push:
tags: ["v*"]
branches: [main]
pull_request:
branches: [main]

jobs:
build:
Expand All @@ -24,29 +26,3 @@ jobs:

- name: Build Chrome zip
run: make build


- name: Build Firefox xpi
run: |
npx web-ext build --source-dir=. --artifacts-dir=. \
--ignore-files="node_modules/*" "test/*" "demo/*" "*.svg" \
"package*.json" "eslint.config.*" ".github/*" "AGENTS.md" \
"CLAUDE.md" "CHANGELOG.md" "PRIVACY.md" "README.md" ".gitignore" \
".node-version" "docs/*" "Makefile"
mv github_pr_dashboard-*.zip github-pr-dashboard-firefox-unsigned.xpi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
github-pr-dashboard-chrome.zip
github-pr-dashboard-firefox-unsigned.xpi
generate_release_notes: true
append_body: true
body: |
## Install

| Browser | File | Notes |
|---------|------|-------|
| Chrome | `github-pr-dashboard-chrome.zip` | Unzip, then Load unpacked in `chrome://extensions` |
| Firefox | `github-pr-dashboard-firefox-unsigned.xpi` | **Unsigned** — works as a temporary add-on only (removed on browser close). For a persistent install, use the signed version from [addons.mozilla.org](https://addons.mozilla.org) when available. |
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags: ["v*"]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .node-version

- run: npm ci

- name: Lint
run: npx eslint *.js

- name: Test
run: npm test

- name: Build Chrome zip
run: make build

- name: Build Firefox xpi
run: |
npx web-ext build --source-dir=. --artifacts-dir=. \
--ignore-files="node_modules/*" "test/*" "demo/*" "*.svg" \
"package*.json" "eslint.config.*" ".github/*" "AGENTS.md" \
"CLAUDE.md" "CHANGELOG.md" "PRIVACY.md" "README.md" ".gitignore" \
".node-version" "docs/*" "Makefile"
mv github_pr_dashboard-*.zip github-pr-dashboard-firefox-unsigned.xpi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
github-pr-dashboard-chrome.zip
github-pr-dashboard-firefox-unsigned.xpi
generate_release_notes: true
append_body: true
body: |
## Install

| Browser | File | Notes |
|---------|------|-------|
| Chrome | `github-pr-dashboard-chrome.zip` | Unzip, then Load unpacked in `chrome://extensions` |
| Firefox | `github-pr-dashboard-firefox-unsigned.xpi` | **Unsigned** — works as a temporary add-on only (removed on browser close). For a persistent install, use the signed version from [addons.mozilla.org](https://addons.mozilla.org) when available. |
39 changes: 25 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL := menu
.PHONY: menu install test lint ci build demo release help list
.PHONY: menu install test lint ci build demo release tag help list

# Colors
CYAN := \033[36m
Expand Down Expand Up @@ -31,8 +31,9 @@ menu:
@printf " $(YELLOW)5)$(RESET) make ci $(DIM)Run lint + test + build (CI pipeline)$(RESET)\n"
@printf "\n"
@printf " $(BOLD)$(GREEN)=== Release ===$(RESET)\n"
@printf " $(YELLOW)6)$(RESET) make release $(DIM)Bump version, tag, and push$(RESET)\n"
@printf " $(YELLOW)7)$(RESET) make demo $(DIM)Build demo extension for screenshots$(RESET)\n"
@printf " $(YELLOW)6)$(RESET) make release $(DIM)Bump version and create PR$(RESET)\n"
@printf " $(YELLOW)7)$(RESET) make tag $(DIM)Tag merged release and push$(RESET)\n"
@printf " $(YELLOW)8)$(RESET) make demo $(DIM)Build demo extension for screenshots$(RESET)\n"
@printf "\n"
@read -p " Enter choice: " choice; \
case $$choice in \
Expand All @@ -42,7 +43,8 @@ menu:
4) $(MAKE) install ;; \
5) $(MAKE) ci ;; \
6) $(MAKE) release ;; \
7) $(MAKE) demo ;; \
7) $(MAKE) tag ;; \
8) $(MAKE) demo ;; \
*) echo "Invalid choice" ;; \
esac

Expand Down Expand Up @@ -97,20 +99,28 @@ release:
esac; \
if [ -z "$$VERSION" ]; then echo "Aborted."; exit 1; fi; \
printf "\n$(BOLD)Releasing $(CYAN)v$$VERSION$(RESET)\n\n"; \
BRANCH="release/v$$VERSION"; \
git checkout main; \
git pull --ff-only origin main; \
if [ -n "$$(git status --porcelain)" ]; then echo "Working tree not clean"; exit 1; fi; \
git checkout -b "$$BRANCH"; \
Comment on lines +102 to +106

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find . -name "Makefile" -type f | head -5

Repository: internetblacksmith/github-pr-dashboard

Length of output: 92


🏁 Script executed:

cat -n ./Makefile | head -120

Repository: internetblacksmith/github-pr-dashboard

Length of output: 5783


Add fail-fast to the release recipe to prevent continuing after git errors.

The recipe runs as a single shell command list with backslash continuations. Without set -e, failures on lines 103 (git checkout), 104 (git pull), or 106 (git checkout -b) will not exit the script, allowing subsequent operations like package.json modifications to proceed on the wrong branch or state. Add set -eu at the recipe start.

Suggested fix
 release:
-	`@CURRENT`=$$(node -p "require('./package.json').version"); \
+	`@set` -eu; \
+	CURRENT=$$(node -p "require('./package.json').version"); \
 	MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
 	MINOR=$$(echo $$CURRENT | cut -d. -f2); \
 	PATCH=$$(echo $$CURRENT | cut -d. -f3); \
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 102 - 106, The release recipe in the Makefile must
fail fast: add "set -eu" at the start of the shell command list for the release
target so any failing git operation (e.g., the git checkout, git pull, or git
checkout -b steps referenced by BRANCH, git checkout, git pull, git status, git
checkout -b) will abort the recipe immediately; update the recipe to run "set
-eu" before executing the existing BRANCH=... and git commands.

node -e "var p=require('./package.json');p.version='$$VERSION';require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"; \
sed -i 's/"version": ".*"/"version": "'"$$VERSION"'"/' manifest.json; \
$(MAKE) ci; \
git add package.json manifest.json; \
git commit -m "Release v$$VERSION"; \
git tag "v$$VERSION"; \
printf "\n$(BOLD)$(GREEN)Tagged v$$VERSION$(RESET)\n"; \
read -p "Push to remote? [y/N] " PUSH; \
if [ "$$PUSH" = "y" ] || [ "$$PUSH" = "Y" ]; then \
git push && git push --tags; \
printf "$(BOLD)$(GREEN)Pushed. GitHub Actions will create the release.$(RESET)\n"; \
else \
printf "Run $(CYAN)git push && git push --tags$(RESET) when ready.\n"; \
fi
git push -u origin "$$BRANCH"; \
gh pr create --title "Release v$$VERSION" --body "Bump version to $$VERSION" --base main; \
printf "\n$(BOLD)$(GREEN)PR created for v$$VERSION$(RESET)\n"; \
printf " After merging, run: $(CYAN)make tag VERSION=$$VERSION$(RESET)\n\n"

tag:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@if [ -z "$(VERSION)" ]; then echo "Usage: make tag VERSION=x.y.z"; exit 1; fi
@git checkout main
@git pull
Comment on lines +119 to +120

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's locate and read the Makefile around lines 119-120
fd -name "Makefile" -type f | head -5

Repository: internetblacksmith/github-pr-dashboard

Length of output: 312


🏁 Script executed:

# Read the Makefile to see full context around lines 119-120
wc -l Makefile

Repository: internetblacksmith/github-pr-dashboard

Length of output: 94


🏁 Script executed:

# Get context around lines 119-120
sed -n '100,135p' Makefile

Repository: internetblacksmith/github-pr-dashboard

Length of output: 1873


Use --ff-only pull in tag to avoid tagging unintended local merges.

Line 120 uses plain git pull, which can create a merge commit if the local main branch diverges from upstream. That merge commit would then be tagged and pushed, bypassing the intended "merged-main-only" release path. The release target already uses --ff-only for this same operation; the tag target should match.

Suggested fix
 	`@git` checkout main
-	`@git` pull
+	`@git` pull --ff-only origin main
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@git checkout main
@git pull
`@git` checkout main
`@git` pull --ff-only origin main
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 119 - 120, The tag target currently runs a plain git
pull (after git checkout main) which can create a merge commit; update the tag
target to use a fast-forward-only pull by changing the git pull invocation to
include --ff-only so it mirrors the release target and prevents accidental local
merge commits from being tagged.

@git tag "v$(VERSION)"
@git push origin "v$(VERSION)"
@printf "\n$(BOLD)$(GREEN)Tagged v$(VERSION) — GitHub Actions will create the release.$(RESET)\n"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

help:
@printf "\n"
Expand All @@ -121,7 +131,8 @@ help:
@printf " $(CYAN)make build$(RESET) Create distributable zip\n"
@printf " $(CYAN)make install$(RESET) Install dev dependencies\n"
@printf " $(CYAN)make ci$(RESET) Run lint + test + build\n"
@printf " $(CYAN)make release$(RESET) Bump version, tag, and push\n"
@printf " $(CYAN)make release$(RESET) Bump version and create PR\n"
@printf " $(CYAN)make tag$(RESET) Tag merged release and push\n"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@printf " $(CYAN)make demo$(RESET) Build demo extension for screenshots\n"
@printf "\n"

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ make lint # Run ESLint
make build # Create distributable zip
make ci # All of the above
make demo # Build demo extension for screenshots
make release # Interactive version bump, tag, and push
make release # Bump version and create PR
make tag # Tag merged release and push
```

## License
Expand Down
Loading