Primary finding
Hardcoded upstream repo and branch names reduce robustness
- .github/workflows/sync-upstream.yml:33-34
- .github/workflows/sync-upstream.yml:39
- .github/workflows/sync-upstream.yml:54
- .github/workflows/sync-upstream.yml:89
The workflow assumes the upstream default branch is named "main" and that the upstream repo location remains constant. If the upstream project renames its default branch or moves repositories, fetch/merge steps will fail. Similarly, creating a PR against "main" will be incorrect if the fork's default branch changes. These hardcoded values make the workflow brittle and prone to silent breakage when defaults change.
Recommendation
Parameterize both the upstream repository and branch, and the fork base branch. - Define env vars or workflow inputs, e.g.: - env: BASE_BRANCH: ${{ github.event.repository.default_branch }} - env: UPSTREAM_REPO: aaronjmars/aeon (or from a repository variable) - env: UPSTREAM_BRANCH: main (or discover via GitHub API or `git remote show upstream`) - Replace occurrences: - `git fetch upstream main` -> `git fetch upstream "$UPSTREAM_BRANCH"` - `git rev-list --count HEAD..upstream/main` -> `...HEAD..upstream/$UPSTREAM_BRANCH` - `git merge --no-edit upstream/main` -> `... upstream/$UPSTREAM_BRANCH` - `gh pr create --base main` -> `--base "$BASE_BRANCH"`