Skip to content

Fix release-branch-manager failure caused by conflicting flat release branch#35

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-action-release-branch-manager
Draft

Fix release-branch-manager failure caused by conflicting flat release branch#35
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-action-release-branch-manager

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown

The release-branch-manager job was failing with [remote rejected] (directory file conflict) when trying to push release/v3 (and release/v1, release/v2). An orphaned flat release branch existed in the repo — git stores branch refs as filesystem paths, so refs/heads/release (file) blocks creation of refs/heads/release/v3 (requires refs/heads/release to be a directory).

Changes

  • .github/workflows/release.yml: Added a cleanup job that runs before github-action (via needs: cleanup) and deletes the conflicting flat release branch via the GitHub API. Handles both HTTP 404 and 422 gracefully so the step is a no-op if the branch doesn't exist.
jobs:
  cleanup:
    runs-on: ubuntu-latest
    steps:
      - name: Delete conflicting flat 'release' branch if it exists
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            try {
              await github.rest.git.deleteRef({
                owner: context.repo.owner,
                repo: context.repo.repo,
                ref: 'heads/release'
              });
              core.info('Deleted conflicting "release" branch.');
            } catch (e) {
              if (e.status === 404 || e.status === 422) {
                core.info('No conflicting "release" branch found, skipping.');
              } else {
                throw e;
              }
            }

  github-action:
    needs: cleanup
    uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
    secrets: inherit

Copilot AI changed the title [WIP] Fix failing GitHub Actions job for release-branch-manager Fix release-branch-manager failure caused by conflicting flat release branch Jun 22, 2026
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.

2 participants