git-mirror-action icon indicating copy to clipboard operation
git-mirror-action copied to clipboard

Fail when use organization secret in workflow

Open tuoping opened this issue 2 years ago • 5 comments

Automatic mirror works when I use a secret stored in the source repo. But failed when I used a secret stored in organization. Here is my workflow .yml file:

jobs:
  git-mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: wearerequired/git-mirror-action@v1
        env:
          SSH_PRIVATE_KEY: ${{ secrets.SYNC_REPO_PRIVATE_KEY }}
        with:
          source-repo: "[email protected]:source.git"
          destination-repo: "[email protected]:destination.git"

tuoping avatar Jul 16 '21 15:07 tuoping

I just met the same problem as you. I think this action used the default repo user (for an organization, the user is the org) to auth to github instead. Is there any way to designate authoring user?

CharesFang avatar Aug 16 '21 06:08 CharesFang

@CharesFang The user should be always git which is defined as part of the source/destination repo inputs.

ocean90 avatar Aug 16 '21 06:08 ocean90

@CharesFang The user should be always git which is defined as part of the source/destination repo inputs.

Thanks for your reply! I'm trying to find out the bugs.

CharesFang avatar Aug 16 '21 07:08 CharesFang

This works.

jobs:
  git-mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: wearerequired/git-mirror-action@v1
        env:
          SSH_PRIVATE_KEY: ${{ secrets.SYNC_REPO_PRIVATE_KEY }}
        with:
          source-repo: "https://github.com/source.git"
          destination-repo: "[email protected]:destination.git"

tuoping avatar Aug 16 '21 08:08 tuoping

This works.

jobs:
  git-mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: wearerequired/git-mirror-action@v1
        env:
          SSH_PRIVATE_KEY: ${{ secrets.SYNC_REPO_PRIVATE_KEY }}
        with:
          source-repo: "https://github.com/source.git"
          destination-repo: "[email protected]:destination.git"

Thanks a lot! I have just fix my bugs. I made some mistakes in ssh key configurations. Thank you all guys!

CharesFang avatar Aug 16 '21 08:08 CharesFang