Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not read username error. #279

Closed
portlek opened this issue Jun 15, 2020 · 15 comments
Closed

Could not read username error. #279

portlek opened this issue Jun 15, 2020 · 15 comments

Comments

@portlek
Copy link

portlek commented Jun 15, 2020

My github action is giving me the error.

image

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Initiate repository
        uses: s4u/maven-settings-action@v2.1.0
        env:
          MAVEN_READ_URL: ${{ secrets.MAVEN_READ_URL }}
          MAVEN_SERVER_ID: ${{ secrets.MAVEN_SERVER_ID }}
          MAVEN_SERVER_PASSWORD: ${{ secrets.MAVEN_SERVER_PASSWORD }}
          MAVEN_SERVER_USERNAME: ${{ secrets.MAVEN_SERVER_USERNAME }}
        with:
          servers: '[{"id": "%MAVEN_SERVER_ID%", "username": "%MAVEN_SERVER_USERNAME%", "password": "%MAVEN_SERVER_PASSWORD%"}]'
          properties: '[{"myMavenRepo.read": "%MAVEN_READ_URL%"}]'

      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          path: main

      - name: Checkout private repository
        uses: actions/checkout@v2
        with:
          repository: MinecraftHouse/Ppom
          token: ${{ secrets.ACCESS_TOKEN }}
          path: ppom

#      - name: Build with Maven
#        run: mvn install -Dgpg.skip=true -B -ntp --file pom.xml --settings /home/runner/.m2/settings.xml
@ericsciple
Copy link
Contributor

Does it fail on forks PRs only?

@ericsciple
Copy link
Contributor

Check the details in issue #221

@portlek
Copy link
Author

portlek commented Jun 16, 2020

the error changed;
image
i have ACCESS_TOKEN token tho
image
and It's not forks or something like that. it's my repo.

@portlek
Copy link
Author

portlek commented Jun 18, 2020

the error changed;
image
i have ACCESS_TOKEN token tho
image
and It's not forks or something like that. it's my repo.

the error is same with 2.3.1 version

@ericsciple
Copy link
Contributor

Since the token input isnt printed, it looks like ${{ secrets.ACCESS_TOKEN }} is resolving to empty. Here is where the runner prints the inputs.

Can you verify you have a secret ACCESS_TOKEN on the repo? May need to update it.

It doesn't look specific to checkout. The following workflow would have the same result:

on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: |
          if [[ "${{secrets.NO_SUCH_SECRET}}" == "" ]]; then
            echo The secret does not exist
          else
            echo The secret exists
          fi

@portlek
Copy link
Author

portlek commented Jun 18, 2020

image
image
I add asdadas code into the TEST but it's empty too.

@portlek
Copy link
Author

portlek commented Jun 18, 2020

ok i found the bug, it was about repo secrets. I didn't add my secrets into repo secrets, it was in the organization secrets where is here
image
so i add a repo secret called TEST and it worked fine. but it's annoying for me because my secrets are for my all repositories not just 1 and i have 20+ repositories ;( i need a solution for that...

@ericsciple
Copy link
Contributor

I haven't tried it, but this doc seems to indicate it's possible

let me know if that helps

@portlek
Copy link
Author

portlek commented Jun 18, 2020

yea i know it, i add my secrets with following this doc. so checkout is not working with organization secret i think. this situation should proof with other users. in my case, its not working.

@Zethson
Copy link

Zethson commented Nov 7, 2020

Does this suggest the same problem?

https://github.com/luiskuhn/biomedical_semantic_segmentation/runs/1366466968?check_suite_focus=true

I am confused, since there should be a repository secret set with the required value.

@portlek
Copy link
Author

portlek commented Nov 7, 2020

I don't remember what was going on here but I solved my problem with a different way, this issue can close.

@Zethson
Copy link

Zethson commented Nov 7, 2020

@portlek Well, please keep it open for me :)

@brpaz
Copy link

brpaz commented Jun 13, 2021

I am getting the same error here.

The strange part is that I have two workflows in the same project and only one of them fails. The checkout code is the same.

@munibrahman
Copy link

Facing same issue, could be related to switching github accounts?

I was using account A before but now I am using account B.

@GiriRaj249
Copy link

I don't remember what was going on here but I solved my problem with a different way, this issue can close.

how did you get it solved ? can you explain it? i am getting same problem with my organization workflow

@portlek portlek closed this as completed Oct 21, 2023
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

No branches or pull requests

6 participants