URL partially replaced inside git push

Hi,

I am trying to deploy Heroku through a GitHub action but when I try to push the destination url is partially substituted.

This is my code:

name: CI
env:
    HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
    HEROKU_APP_NAME: ${{ 'parc-api-staging' }}
on:
  push:
    branches:
      - new_backend
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Deploy to Heroku
      run: git push "https://heroku:$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git" new_backend:master

And this is the response of GitHub action:

Run git push "***git.heroku.com/$HEROKU_APP_NAME.git" new_backend:master
  git push "***git.heroku.com/$HEROKU_APP_NAME.git" new_backend:master
  shell: /bin/bash -e {0}
  env:
    HEROKU_API_TOKEN: ***
    HEROKU_APP_NAME: parc-api-staging
fatal: not a git repository (or any of the parent directories): .git
##[error]Process completed with exit code 128.

 As you can see my url is replaced by:

https://heroku:$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git

To:

$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git

I have already tried to quote the URL but same result.

Thanks.

Hi @josel567 ,

It does not replace “ https://heroku:$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git ” with “ $HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git ”, it should be replaced with “ ***git.heroku.com/$HEROKU_APP_NAME.git ”.
It actually replaces “ username:PAT ” with “ *** ” in the URL when print it into the logs, this should be considering to protect the security of the authentication info (username and password/PAT). So this is not a question, and it does not affect the normal execution of the command.