Skip to content

Add a fallback when fork tokens cannot post comments - #104

Open
Pybsama wants to merge 1 commit into
github:mainfrom
Pybsama:codex/fallback-when-comment-forbidden
Open

Add a fallback when fork tokens cannot post comments#104
Pybsama wants to merge 1 commit into
github:mainfrom
Pybsama:codex/fallback-when-comment-forbidden

Conversation

@Pybsama

@Pybsama Pybsama commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • catch the known Resource not accessible by integration error when a fork workflow token cannot create or update a comment
  • emit a GitHub warning and log the complete comment that would have been posted
  • add the same message to the Actions Job Summary when it is available
  • preserve the original exit code and stderr for every other command failure
  • route all seven PR, Issue, and Discussion create/update paths through the fallback
  • make top-level Discussion comments use the helper's explicit ID and message arguments

Fixes #44.

Testing

  • added Bash subprocess tests for success, the known fork permission error, unexpected failures, multiline argument preservation, and top-level Discussion parameters
  • confirmed the fallback tests fail against the previous implementation before the helper exists
  • npm ci && npm test — 10 tests passed
  • focused test file repeated 20 times
  • bash -n queries.sh
  • parsed action.yml with js-yaml
  • git diff --check

@Pybsama

Pybsama commented Aug 29, 2026

Copy link
Copy Markdown
Author

Fresh current-main validation update:

  • PR head 8645d27afd80b2bc471de85bc57826d81a436d9c is ahead 1 / behind 8 relative to current main 9984e213ae846b8c2342d393085e2483a615f8db. The eight upstream commits only change package.json and package-lock.json; a merge-tree simulation is conflict-free and produces tree f9a1824e1b5a53074f9fbf1000043784db8bb162.
  • On that exact merge-equivalent tree, lockfile installation and the complete Vitest suite passed 10/10 on Node 24.11.1 and Node 20.19.5. The Node 24 suite also passed 20 consecutive full-suite repetitions.
  • bash -n queries.sh passed. action.yml, the CI workflow, and the self-test workflow all parse with the current pinned js-yaml. Target-file and staged diff checks pass.
  • No equivalent implementation is present on current main or in another PR.
  • The existing CI and Test Accessibility-alt-text-bot runs are both action_required with zero jobs, so they are waiting for maintainer approval rather than reporting test failures.
  • Prior independent review found no remaining blocking issue. The original head remains mergeable, so I have not rewritten it solely for dependency-only drift. Ready for review.

@Pybsama
Pybsama marked this pull request as ready for review August 29, 2026 06:53
@Pybsama
Pybsama requested a review from a team as a code owner August 29, 2026 06:53
@Pybsama
Pybsama requested a review from kendallgassner August 29, 2026 06:53
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.

🐛 Bug: No fallback behavior for action runs on forks

1 participant