Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fatal: A branch named 'main' already exists. #1388

Open
Labels
@nschloe

Description

@nschloe

In a GitHub action, I create a fresh repo with

      -name:Create new GitHub repositoryrun:|          curl \            --request POST \            --header "Accept: application/vnd.github+json" \            --header "Authorization: Bearer ${{ secrets.MY_TOKEN }}"\            --header "X-GitHub-Api-Version: 2022-11-28" \            --data '{              "name": "foobar",              "private": true,              "visibility": "private",            }' \            --url "https://api.github.com/orgs/<org>/repos"

I'd like to deploy to this repo with

      -name:Deploy to GitHubuses:JamesIves/github-pages-deploy-action@v4with:token:${{ secrets.MY_TOKEN }}repository-name:"<org>/foobar"branch:mainfolder:deploy/single-commit:true

This then fails with

Checking configuration and starting deployment… 🚦Deploying using Deploy Token… 🔑Configuring git…/usr/bin/git config --global --add safe.directory /__w/baz/baz/usr/bin/git config user.name nschloe/usr/bin/git config user.email nschloe@users.noreply.github.com/usr/bin/git config core.ignorecase false/usr/bin/git config --local --unset-all http.https://github.com/.extraheader/usr/bin/git remote rm origin/usr/bin/git remote add origin ***github.com/<org>/foobar.gitGit configured… 🔧Starting to commit changes…/usr/bin/git ls-remote --heads ***github.com/<org>/foobar.git refs/heads/mainCreating worktree…/usr/bin/git worktree add --no-checkout --detach github-pages-deploy-action-temp-deployment-folderPreparing worktree (detached HEAD fb01a93)/usr/bin/git checkout --orphan mainfatal: A branch named 'main' already exists.

Any idea what's going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp