I'm using github actions
to push some code in my other git repo.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Push remote
run: |
git config user.name "myusername"
git config user.email "myusername@gmail.com"
git remote set-url origin "https://myusername:$GIT_TOKEN@github.com/myusername/AnotherRepo"
git add mytext.txt
git commit -m "Pushing mytext with remote push"
git push
GIT_TOKEN
is set as repo secrets of the current git repo. In this token I've provided all permissions.
Yet I'm getting error:
fatal: repository 'https://github.com/myusername/AnotherRepo.git/' not found.
From the answer here it seems it is a permission issue.
But both of these repos belong to me so why am I getting this error.
If I try to push file in the same source repo (where git action is running) then there is no issue.
So there is no issue in the action yaml.
What am I missing?
PS. I've also tried with ${{ secrets.GIT_TOKEN }}