Docs: --commit-id publishes the changes in that commit, not since it (publish.md example uses github.event.before)

Open Beginner friendly
#333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
azure, github-actions, typescript
Domain
cli, documentation

Research direction

Start with docs/commands/publish.md and compare its --commit-id description and GitHub Actions example with src/services/git-diff-service.ts and the generated workflow references in src/templates/github-actions/publish-workflow.ts. Update the wording and example to match the behavior described in the issue; clarify the multiple-commit case if appropriate. Done when the docs accurately explain which commit is published and use the matching GitHub Actions value.

Written by the indexing model from the issue text.

Description

stale

docs/commands/publish.md describes --commit-id differently from what the code and the generated pipelines do.

Docs (Incremental publish):

When --commit-id is provided, apiops publish uses git diff to identify which artifact files changed since that commit.

and the GitHub Actions example passes the commit before the push:

- run: npx apiops publish --commit-id ${{ github.event.before }}

Code (src/services/git-diff-service.ts) diffs commitId~1 against commitId, so it publishes the changes made by that commit, not the changes since it.

The generated pipelines agree with the code: the GitHub Actions template passes GITHUB_SHA (publish-workflow.ts) and the Azure DevOps template passes $(Build.SourceVersion).

Effect of following the docs example: with github.event.before, publish diffs the previous push's last commit against its parent. It republishes the previous push's last commit and skips the commit that just landed. The run succeeds, so nothing flags it.

Suggested fix: change the sentence to "identify which artifact files changed in that commit (compared with its parent)" and the example to --commit-id ${{ github.sha }}. If a push contains several commits, it may also be worth saying that only the last one is published, or supporting a range.

Seen on 1.0.5 (npm) and on main at 129fb32.

Dominant language
TypeScript
Stars
44
Forks
14
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/apiops-cli

All issues in Azure/apiops-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.