1

I am setting up a Soarqube server using Github actions. I want to debug the Github secret but I'm unable to do so. I am attaching .yml file for reference.

name: Show Me the S3cr3tz
on:
  # push:
  #   branches-ignore: [master, main]
  #   # Remove the line above to run when pushing to master
  pull_request:
    branches: [master, develop, main]
jobs:
  debug:
    name: Debug
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v2

      - name: Set up secret file
        env:
          SONAR_HOST: ${{ secrets.SONAR_HOST }}
        run: |
          echo ${{secrets.SONAR_HOST }} | sed 's/./& /g'

I am getting an error /home/runner/work/_temp/c2186355-2b94-4792-b8de-d5cf288bcc9a.sh: line 2: syntax error near unexpected token |'`

node_modules
  • 4,790
  • 6
  • 21
  • 37
  • Use the echo command to print out the value of the secret, so you can verify that it is being correctly accessed in the YML file. For example, if your secret is named MY_SECRET, you can use the following command to print it out: echo "The value of MY_SECRET is: $MY_SECRET" – Nishanth Dec 05 '22 at 07:46

0 Answers0