Skip to content

fix: replace all topics so dropped topics are removed - #78

Merged
030 merged 1 commit into
mainfrom
fix-67-sync-topics
Oct 10, 2026
Merged

030 merged 1 commit into
mainfrom
fix-67-sync-topics

Conversation

@sbp-bvanb

Copy link
Copy Markdown
Collaborator

What and why

Up to now topics were applied with gh repo edit --add-topic. That only adds topics, so a topic removed from the topics input stayed on the repository, and the repository no longer matched the config.

The step now calls gh api -X PUT repos/$PROJECT/topics with one -f names[]=<topic> per topic. This replaces all repository topics with exactly the list in the input.

Behaviour change: topics on the repository that are not in topics are now removed. This is noted in docs/inputs.md.

Testing

  • action.yml parses as YAML, and bash -n passes on the extracted step script.
  • I ran the step with a stub gh and checked that it passes -f names[]=... once per comma-separated topic.
  • I sent GH_DEBUG=api gh api -X PUT repos/030/does-not-exist-zz9/topics -f 'names[]=a' -f 'names[]=b-c' to a repository that does not exist (it returned 404, so nothing changed). The debug output showed the body is a JSON names array.
  • Not tested: I could not run the action against a real repository.
  • The general/PR-validation checks on this fork end in startup_failure because the fork's Actions policy blocks schubergphilis/* actions. That happens on every PR here, not because of this change.

Closes #67

🤖 Generated with Claude Code

Topics were only added with gh repo edit --add-topic, so a topic
removed from the input stayed on the repository. Set the full list
with PUT repos/{owner}/{repo}/topics instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@030
030 merged commit 8452312 into main Oct 10, 2026
8 checks passed
@030
030 deleted the fix-67-sync-topics branch October 10, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Should fix] Topics are only added, never removed

2 participants