Skip to content

Use self references in reusable workflows - #91

Merged
dceoy merged 22 commits into
mainfrom
agent/update-reusable-workflow-docs
Aug 16, 2026
Merged

Use self references in reusable workflows#91
dceoy merged 22 commits into
mainfrom
agent/update-reusable-workflow-docs

Conversation

@dceoy

@dceoy dceoy commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace nested dceoy/opencode-action@v0 calls with the GitHub.com $/. self repository root reference
  • remove the extra OpenCode action checkout and the action-ref reusable-workflow input
  • remove the repository-level opencode.yml wrapper
  • let opencode-review.yml run directly on eligible pull request events and opencode-bot.yml run directly on eligible comment events
  • preserve reusable-workflow behavior while providing repository-local defaults for direct event runs
  • pin the reusable-workflow documentation examples to a commit that already contains the $/. implementation
  • update post-release automation to refresh the README action pin, README actions/checkout pin, and reusable workflow documentation pins
  • document the provider secrets added by Support additional OpenCode provider secrets #90
  • document the called workflow's contents: read token ceiling and the separately write-scoped GH_TOKEN required for code-writing tasks

Rationale

This follows up on the unresolved review thread from #89 while removing the mutable nested v0 dependency.

GitHub.com's $/path self repository syntax resolves an action against the repository and commit of the workflow where the reference appears. Because this action is defined at the repository root, the reusable workflows use uses: $/.. Therefore, when a caller pins dceoy/opencode-action/.github/workflows/opencode-*.yml@<SHA>, the nested action resolves to the same repository at that running commit without a second checkout or a separate revision input.

The repository no longer needs a separate caller workflow: the reusable workflows also declare the repository events they handle. Repository-local runs retain the previous author, draft, dependency-bot, and mention filters, while reusable callers retain their prior behavior.

Release automation now keeps published examples synchronized by resolving the OpenCode release tag to its commit SHA, resolving the latest actions/checkout release to its commit SHA, and updating the README plus both reusable-workflow pins in docs/reusable-workflows.md. The workflow fails closed if the expected pin counts drift.

Validation

  • verified GitHub's current self-repository syntax requires a non-empty path and resolves against the called workflow's repository and commit
  • use $/. to target this repository's root action
  • removed action-ref from both reusable workflow APIs and documentation examples
  • removed the second actions/checkout step from both reusable workflows
  • preserved the repository checkout required for operating on the caller repository
  • preserved repository-local pull-request and mention filters
  • added a path-scoped actionlint ignore for its current false positive on GitHub's $/. syntax; other actionlint diagnostics remain enabled
  • pinned both reusable-workflow examples to de968892b27dd42727fa175cd00610a54d091bf9, which contains the corrected self-reference implementation
  • post-release pin replacement validates exactly one README OpenCode action reference, exactly one README actions/checkout reference, and exactly two reusable workflow references before editing
  • verified the current latest actions/checkout release is v7.0.1 and resolves to 3d3c42e5aac5ba805825da76410c181273ba90b1

Follow-up to #89 and #90.

@dceoy dceoy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one blocking CI issue in the documentation table. The workflow/action pinning change itself is consistent, and the Actions/YAML/security checks pass.

Comment thread docs/reusable-workflows.md Outdated
@dceoy dceoy self-assigned this Aug 16, 2026
@dceoy dceoy changed the title Use pinned local actions in reusable workflows Use self references in reusable workflows Aug 16, 2026
@dceoy
dceoy marked this pull request as ready for review August 16, 2026 05:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7030eedcd0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/reusable-workflows.md Outdated
@dceoy
dceoy force-pushed the agent/update-reusable-workflow-docs branch from 5f2d47f to 2f992f1 Compare August 16, 2026 06:53
@dceoy

dceoy commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

/oc Ping.

@opencode-agent

Copy link
Copy Markdown

Pong. I’m here.

github run

@dceoy dceoy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one blocking workflow issue. The $/ feature itself is appropriate here, and GitHub documents that it resolves against the called workflow's repository/commit, but the root-form used in this PR has an empty action path. The current Actions runner implementation rejects an empty path after $/; CI is green because these event workflows are not exercised on synchronize.

Comment thread .github/workflows/opencode-review.yml Outdated
Comment thread .github/workflows/opencode-bot.yml Outdated
@dceoy
dceoy merged commit 78b1a18 into main Aug 16, 2026
9 checks passed
@dceoy
dceoy deleted the agent/update-reusable-workflow-docs branch August 16, 2026 10:39
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.

1 participant