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

fix: checkout action using a github pat #358

Merged
merged 1 commit into from
Jul 15, 2023
Merged

fix: checkout action using a github pat #358

merged 1 commit into from
Jul 15, 2023

Conversation

dotdc
Copy link
Contributor

@dotdc dotdc commented Jul 12, 2023

Description

Close #357

This will fix a checkout issue when using a GitHub PAT.
I also renamed the PAT variable from SOURCE_REPO_PAT to CUSTOM_GITHUB_PAT in order to avoid match overlap with SOURCE_REPO_PATH.

Remark

For automation please see closing-issues-using-keywords

Signed-off-by: David Calvert <david.calvert@oqton.com>
@AndreasAugustin
Copy link
Owner

@dotdc thanks a lot for the fix.
Did you by any chance forget to push some files related to #357 ?
Actually I only see a documentation change (which makes sense in terms of readability, but I need to think about it in terms of domain namings. Everyone can use a self defined name here.).

@dotdc
Copy link
Contributor Author

dotdc commented Jul 12, 2023

Yes documention change only, does anything else require a change ?

Didn't search and replace repo wide, but will check tomorrow morning 👍

@AndreasAugustin
Copy link
Owner

AndreasAugustin commented Jul 12, 2023

Yes documention change only, does anything else require a change ?

Didn't search and replace repo wide, but will check tomorrow morning +1

Ah alright, please let me rephrase your issue with #357 and let me know if I got it right
You had a typo in the secret or the workflow definition which led to the issue?

Just want to understand if there are code related issues. The part you changed is not related to the code. Just your secret needs the name CUSTOM_GITHUB_PAT now, not anymore SOURCE_REPO_PAT

@dotdc
Copy link
Contributor Author

dotdc commented Jul 13, 2023

Yes documention change only, does anything else require a change ?
Didn't search and replace repo wide, but will check tomorrow morning +1

Ah alright, please let me rephrase your issue with #357 and let me know if I got it right You had a typo in the secret or the workflow definition which led to the issue?

Just want to understand if there are code related issues. The part you changed is not related to the code. Just your secret needs the name CUSTOM_GITHUB_PAT now, not anymore SOURCE_REPO_PAT

@AndreasAugustin

No, the issue is that following the current documentation, the workflow will fail with the following error when using a PAT :

git init
  ::info::set git global configuration
  Updated Git hooks.
  Git LFS initialized.
  ::info::the source repository is located within GitHub.
  github.com
    ✓ Logged in to github.com as dotdc (GITHUB_TOKEN)
    ✓ Git operations for github.com configured to use https protocol.
    ✓ Token: *******************
    
remote: Repository not found.
fatal: repository 'https://github.com/***/' not found
fatal: Needed a single revision

To solve the issue, I had to use the PAT on the checkout action (in this PR change) :

        name: Checkout
        uses: actions/checkout@v3
        with:
          token: ${{ secrets.CUSTOM_GITHUB_PAT }}

I also proposed to rename the secret name from SOURCE_REPO_PAT to CUSTOM_GITHUB_PAT, because if you're search for "SOURCE_REPO_PAT" you will also match "SOURCE_REPO_PATH", because they are too close to one another, and this can lead to confusion.

Just checked, there is no other occurrence of SOURCE_REPO_PAT in the repository, so this is only a documentation change.

@AndreasAugustin
Copy link
Owner

Hi @dotdc got it.
Am super sorry. I had been super busy and was reading the PR in a rush. Somehow I did not read the full change..

Makes absolutely sense. Thanks a lot!

@AndreasAugustin
Copy link
Owner

@all-contributors please add @dotdc for bug

@allcontributors
Copy link
Contributor

@AndreasAugustin

I've put up a pull request to add @dotdc! 🎉

@AndreasAugustin AndreasAugustin merged commit 9e4223d into AndreasAugustin:main Jul 15, 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

Successfully merging this pull request may close these issues.

[Bug]: repository 'https://github.com/***/' not found
2 participants