Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Personal Token not working in github workflows

I have 2 repos. One is responsible for the main code and the second one is where things are deployed. (<name>.github.io). To make my life easier I had made a workflow that would take my main code, build it and pushes it into the Github-Page branch of the other repo.

It was working for quite a while but 2-3 months ago it stopped working. Below is a snippet of code where the error is occurring.

Workflow code (breaks at the last line)

git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add origin "https://${{ secrets.AUTH_TOKEN_FOR_DEPLOYMENT }}@github.com/<name>/<name>.github.io.git"

Error:

fatal: could not read Password for 'https://***@github.com': No such device or address
Error: Process completed with exit code 128.

Few things I have tried

  • Refreshing my token (didn't work)
  • ad-m/github-push-action (only worked for force push and I didn't want that)
  • Looking all over google (only came across solutions I have already tried)
  • Asking on reddit (no response)
like image 729
Alpha Wolf Gamer Avatar asked Feb 20 '26 13:02

Alpha Wolf Gamer


1 Answers

Ok, so I found out that when checkout@v3 was rolled out it broke the code that was written with checkout@v2 for some reason. Hence the simple solution to this problem is to update the checkout and setup-node version to v3 instead of v2

like image 124
Alpha Wolf Gamer Avatar answered Feb 27 '26 08:02

Alpha Wolf Gamer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!