Giter VIP home page Giter VIP logo

Comments (4)

andry81 avatar andry81 commented on June 21, 2024

I do not know if you can use the oauth2: syntax when using a PAT token.

I had never being tested the oauth2. Only the PAT have used: https://github.com/settings/tokens

The oauth2 has a different link: https://github.com/settings/developers

The command to do so should be git ls-remote -q --exit-code "https://${{ inputs.token }}@github.com/${{ inputs.repository }}" ${{ inputs.ref }} > /dev/null 2>&1

Thank you for the issue. I will fix that later.

from gh-action--git-checkout.

runecalico avatar runecalico commented on June 21, 2024

The issue I am having is that if I use the GitHub Application token as the input value token in the action, the git ls-remote check will set is-repo-exists-and-has-ref to false, which will skip the actions/checkout@v3 step and instead run "init" and setup a "new" repository. This is a problem when https://github.com/andry81-devops/gh-action--accum-gh-stats tries to push changes back to github.
If I send "oauth2:${{ steps.get_workflow_token.outputs.token }}" or "my-github-app-name:${{ steps.get_workflow_token.outputs.token }}" as the value of token in the action, the git ls-remote works as expected, however actions/checkout@v3 does not.

A quick test using my GitHub account seems to indicate that both a PAT and GitHub Application Token will work with the "oauth2:" syntax, or at least it worked for me :)

image

from gh-action--git-checkout.

andry81 avatar andry81 commented on June 21, 2024

@runecalico can you recheck the issue?

from gh-action--git-checkout.

andry81 avatar andry81 commented on June 21, 2024

@runecalico

A quick test using my GitHub account seems to indicate that both a PAT and GitHub Application Token will work with the "oauth2:" syntax, or at least it worked for me :)

I've tested your command line and it works whenever you are using oauth2, oauth with ghp_*, without or with random key.
This is expected because you are trying to use a public repo which is opened for reading at any case. The token is required for a private repo.

from gh-action--git-checkout.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.