|
| 1 | +# action-gh-release |
| 2 | + |
| 3 | +This repository is maintained as a small, user-facing GitHub Action with a relatively wide compatibility surface. |
| 4 | +Optimize for stability, reproducibility, and clear user value over broad rewrites. |
| 5 | + |
| 6 | +## Core Rules |
| 7 | + |
| 8 | +- Prefer narrow behavior fixes over structural churn. |
| 9 | +- Reproduce current behavior on `master` before changing code. |
| 10 | +- Treat GitHub platform behavior as distinct from action behavior. |
| 11 | + If GitHub controls the outcome, prefer docs or clearer errors over brittle workarounds. |
| 12 | +- Do not revive stale PRs mechanically. |
| 13 | + Reuse the idea if it still has value, but reimplement on top of current `master`. |
| 14 | +- Avoid standalone refactors with no clear user-facing benefit. |
| 15 | + |
| 16 | +## Current Architecture |
| 17 | + |
| 18 | +- `src/main.ts` is the orchestration layer: parse config, validate inputs, create/update release, upload assets, finalize, set outputs. |
| 19 | +- `src/github.ts` owns release semantics: lookup, create/update/finalize, asset upload, race handling, and GitHub API interaction. |
| 20 | +- `src/util.ts` owns parsing and path normalization. |
| 21 | +- Keep behavior-specific logic in `src/github.ts` or `src/util.ts`; avoid growing `src/main.ts` with ad-hoc feature branches. |
| 22 | + |
| 23 | +## Bug-Fix Workflow |
| 24 | + |
| 25 | +- Reproduce the issue against current `master` first. |
| 26 | +- When available, use the companion consumer harness repo `action-gh-release-test`. |
| 27 | +- Capture exact workflow run URLs and release URLs before claiming a fix. |
| 28 | +- If the issue is really a docs/usage or platform-limit case, document it and close it as such instead of forcing a code change. |
| 29 | +- If a historical issue no longer reproduces on current `master`, prefer a short closeout note that asks the reporter to open a fresh issue if they still see it. |
| 30 | + |
| 31 | +## Feature Triage |
| 32 | + |
| 33 | +- Ship features only when there is clear user value or repeated demand. |
| 34 | +- Small convenience features are fine, but they should stay small. |
| 35 | +- Weak-demand features should not expand parsing complexity, cross-platform ambiguity, or maintenance surface. |
| 36 | +- For old feature PRs: |
| 37 | + - check whether current `master` already covers the behavior |
| 38 | + - prefer a tiny docs clarification if the behavior exists but is poorly explained |
| 39 | + - close stale feature PRs when the idea is obsolete, low-value, or badly shaped for the current codebase |
| 40 | + |
| 41 | +## Contract Sync |
| 42 | + |
| 43 | +When behavior changes, keep the external contract in sync: |
| 44 | + |
| 45 | +- update `README.md` |
| 46 | +- update `action.yml` |
| 47 | +- update tests under `__tests__/` |
| 48 | +- regenerate `dist/index.js` with `npm run build` |
| 49 | + |
| 50 | +Docs-only changes do not need `dist/index.js` regeneration. |
| 51 | + |
| 52 | +## Verification |
| 53 | + |
| 54 | +For code changes, run: |
| 55 | + |
| 56 | +- `npm run fmtcheck` |
| 57 | +- `npm run typecheck` |
| 58 | +- `npm run build` |
| 59 | +- `npm test` |
| 60 | + |
| 61 | +For behavior changes, also run the relevant external regression workflow(s) in `action-gh-release-test` against the exact ref under test. |
| 62 | + |
| 63 | +## Release and Triage Conventions |
| 64 | + |
| 65 | +- Keep PR labels accurate. Release notes depend on them. |
| 66 | + - bug fixes: `bug` |
| 67 | + - docs-only changes: `documentation` |
| 68 | + - additive features: `feature` or `enhancement` |
| 69 | + - dependency updates: `dependencies` |
| 70 | +- Prefer manual issue/PR closeouts with a short rationale over implicit assumptions. |
| 71 | +- Do not auto-close old PRs or issues through unrelated docs PRs. |
| 72 | + |
| 73 | +## Implementation Preferences |
| 74 | + |
| 75 | +- Preserve the current upload/finalize flow unless there is strong evidence it needs to change. |
| 76 | +- Prefer upload-time semantics over filesystem mutation. |
| 77 | +- Be careful with parsing changes around `files`, path handling, and Windows compatibility. |
| 78 | +- Be careful with race-condition fixes; verify both local tests and consumer-repo concurrency harnesses. |
| 79 | +- Do not assume a refactor is safe just because tests are green. This action’s behavior is heavily shaped by GitHub API edge cases. |
0 commit comments