Skip to content

fix(ci): resolve Docker build and auto-release failures#157

Merged
YiWang24 merged 1 commit into
mainfrom
fix/ci-docker-and-auto-release
May 26, 2026
Merged

fix(ci): resolve Docker build and auto-release failures#157
YiWang24 merged 1 commit into
mainfrom
fix/ci-docker-and-auto-release

Conversation

@YiWang24

@YiWang24 YiWang24 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes 2 recurring GitHub Actions failures on main:

1. CI › Build Docker — Dockerfile not found

  • Root cause: ci.yml triggers reusable-ci.yml on every push to main, which runs a Docker build. OpenCI is a workflow/actions library, not a containerized app — there's no Dockerfile.
  • Fix: Added paths filter to ci.yml push trigger so the full CI pipeline (including Docker build) only runs when Docker-related files, source code, or ci.yml itself changes. This prevents the spurious failure on OpenCI's own repo while still allowing the CI to run when relevant files are modified.

2. Auto-release › Create tag — Bad credentials (HTTP 401)

  • Root cause: secrets.MY_GITHUB_TOKEN was referenced but is not configured (or expired) in the repo.
  • Fix: Changed to ${{ github.token }} — the workflow already has contents: write permission, which is sufficient for tag creation via the GitHub API.

Files Changed

  • .github/workflows/ci.yml — Added paths filter to push trigger
  • .github/workflows/auto-release.yml — Replaced unconfigured PAT with github.token

Test Plan

  • actionlint validates both workflow files
  • Pre-commit hooks pass (yaml-lint, guard-secrets, etc.)
  • CI: ci workflow should skip on non-Dockerfile changes
  • CI: auto-release should create tags successfully on next release commit

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Updated automated release workflow token handling.
    • Refined CI workflow triggers to run only when relevant files change.

Review Change Stack

Greptile Summary

This PR addresses two recurring CI failures: a spurious Docker build error (no Dockerfile in this workflow library repo) and a 401 on tag creation caused by a missing/expired PAT. The paths filter fix for ci.yml is directionally correct, but both changes introduce new issues that prevent the intended end-to-end release pipeline from working.

  • auto-release.yml: Replacing secrets.MY_GITHUB_TOKEN with github.token eliminates the 401 error, but github.token cannot fire downstream workflow events — release.yml, which listens on push: tags, will never be triggered automatically.
  • ci.yml: The paths filter prevents the Docker build job from failing on irrelevant pushes, but tests/** is absent from the filter, so the harness-test (BATS) job is silently skipped whenever only test files are changed on main.

Confidence Score: 3/5

The auto-release change fixes one failure but breaks the downstream release chain; merging will leave the repo unable to auto-publish releases without manual intervention.

Both files have functional gaps: github.token successfully creates the tag but the push: tags event is suppressed, so release.yml never runs — the stated goal of the fix is not achieved. The paths filter in ci.yml meanwhile silently drops BATS test execution whenever only test files change on main.

Both changed files need attention: auto-release.yml for the token/event-propagation issue, and ci.yml for the missing tests/** path entry.

Important Files Changed

Filename Overview
.github/workflows/auto-release.yml Swapped unconfigured PAT for github.token, which fixes the 401 error but breaks the tag-push event chain that triggers release.yml.
.github/workflows/ci.yml Added paths filter to prevent spurious Docker-build failures, but the filter omits tests/**, so the harness-test (BATS) job is silently skipped on test-only commits to main.

Sequence Diagram

sequenceDiagram
    participant Push as git push to main
    participant AR as auto-release.yml
    participant GH as GitHub API
    participant RL as release.yml

    Push->>AR: workflow triggered (no paths filter)
    AR->>AR: analyze commits, calculate new tag
    AR->>GH: POST /git/refs using github.token
    GH-->>AR: 201 Created tag successfully
    Note over GH,RL: Tag push event is suppressed<br/>github.token cannot trigger<br/>downstream workflows
    RL--xRL: release.yml never runs

    Note over Push,RL: Expected behavior with a valid PAT
    Push->>AR: workflow triggered
    AR->>GH: POST /git/refs using PAT
    GH->>RL: push tags event fires
    RL->>RL: marketplace and docker release runs
Loading

Reviews (1): Last reviewed commit: "fix(ci): resolve Docker build and auto-r..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

- ci.yml: add paths filter to push trigger so Docker build only runs
  when Dockerfile, source code, or ci.yml itself changes. Prevents the
  'Dockerfile not found' error on OpenCI's own repo (no Dockerfile).
- auto-release.yml: replace secrets.MY_GITHUB_TOKEN with github.token.
  MY_GITHUB_TOKEN was not configured, causing 401 on tag creation.
  github.token has contents:write permission which is sufficient.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@YiWang24 YiWang24 merged commit d24a953 into main May 26, 2026
13 of 16 checks passed
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 868bc267-da00-48b7-a923-6eedfb2b2656

📥 Commits

Reviewing files that changed from the base of the PR and between 234cec0 and 65e35bd.

📒 Files selected for processing (2)
  • .github/workflows/auto-release.yml
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

Two GitHub Actions workflow configurations are updated: the auto-release workflow now uses GitHub's built-in token instead of a custom secret for git tag creation, and the CI workflow adds path-based filtering to run only on changes to Docker, source code, and workflow files.

Changes

Auto-release Token Update

Layer / File(s) Summary
Use GitHub Token for Tag Creation
.github/workflows/auto-release.yml
GH_TOKEN environment variable in the tag-creation step switched from secrets.MY_GITHUB_TOKEN to ${{ github.token }}, using GitHub's built-in workflow authentication for the gh api call.

CI Path-based Trigger Optimization

Layer / File(s) Summary
Add Path Filter to Push Trigger
.github/workflows/ci.yml
push event trigger on main branch now includes a paths filter that restricts CI execution to Docker-related files (Dockerfile*, docker-compose*.yml, .dockerignore, *.dockerfile), source code (src/**), and the workflow file itself.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • YiAgent/OpenCI#141: Also modifies the "Create and push tag" step in auto-release.yml, affecting the same tag-creation logic area.

Suggested labels

area:ci

Poem

A rabbit hops through workflows fine,
One token swaps to built-in line,
The other filters paths with care—
Less CI noise floats in the air! 🐰✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-docker-and-auto-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@YiWang24 YiWang24 deleted the fix/ci-docker-and-auto-release branch May 26, 2026 01:03

@openbot-dev openbot-dev 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.

Replaces custom PAT with GITHUB_TOKEN for release tagging and adds path filters to CI workflow; both changes look correct.

@sonarqubecloud

Copy link
Copy Markdown

env:
NEW_TAG: ${{ steps.version.outputs.tag }}
GH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 github.token won't trigger release.yml on tag push

GitHub explicitly prevents GITHUB_TOKEN from triggering downstream workflow runs to avoid infinite loops. release.yml listens on push: tags: ["v*"], so when auto-release.yml creates a tag via the GitHub API using github.token, the tag event is silently swallowed and release.yml never starts. The summary step even says "Release workflow will be triggered automatically," which will no longer be true.

The original secrets.MY_GITHUB_TOKEN PAT was the right approach because a PAT does propagate push tag events. The correct fix is to provision (or reprovision) that secret — or replace it with a GitHub App installation token — rather than switching to github.token.

Comment thread .github/workflows/ci.yml
Comment on lines +9 to +15
paths:
- "Dockerfile*"
- "docker-compose*.yml"
- ".dockerignore"
- "src/**"
- "*.dockerfile"
- ".github/workflows/ci.yml"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 harness-test job silently skipped on test-only changes

The paths filter applies to the entire ci.yml workflow, including the harness-test job. tests/** is not in the filter, so a push that only modifies BATS test files will not trigger the test suite on main. Since this repo IS the OpenCI library, changes to tests/ are a primary concern and should always exercise the BATS runner.

Adding "tests/**" (and optionally ".github/workflows/reusable-ci.yml") to the paths list would restore coverage for test-only commits.

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