Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a comment in GitHub action YML file?

In the below syntax:

jobs:
  testing:
    name: some test
    runs-on: [ self-hosted, linux, xyz ]
    steps:
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.15.0
        id: go

      - name: Configure git client
        run: git config --global url."ssh://[email protected]:".insteadOf "https://github.com/"

How do I add run git client to fix some issue as a comment for the run command?

like image 897
overexchange Avatar asked Feb 19 '26 12:02

overexchange


1 Answers

tl; dr

  • Use : #
- run: git config --global url."ssh://[email protected]:".insteadOf "https://github.com/" # run git client to fix some issue
+ run: |
+   : # run git client to fix some issue
+   git config --global url."ssh://[email protected]:".insteadOf "https://github.com/"

ts; dr

I've been searching the official GitHub docs and googling around but couldn't find any working sample.

And I came up with the answer by using the : operand which just returns true followed by the comment # like so:

jobs:
  testing:
    name: some test
    runs-on: [ self-hosted, linux, xyz ]
    steps:
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.15.0
        id: go

      - name: Configure git client
        run: |
          : # run git client to fix some issue
          git config --global url."ssh://[email protected]:".insteadOf "https://github.com/"
like image 124
KEINOS Avatar answered Feb 27 '26 10:02

KEINOS



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!