Unable to edit and capture Super Linter error into GitHub Issue

I am using Superlinter actions in GitHub Actions for code linting. I would like to trigger action once issue is created, and capture error that is raised by SQLFluff (Linter in SuperLiner) into the issue that was raised by the user. Currently, my main workflow file looks like below. However, for some reason I am unable to capture the error that is raised by linter into the issue. What am I missing?

Main.yml (Updated code after jonrsharpe comment)

name: close-issue-after-lint-open
on:
  issues:
    types: [opened]
jobs:
  close-issue:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read
      packages: read
      statuses: write
    steps:
      - name: Checkout code
        uses: actions/[email protected]
        with:
          fetch-depth: 0
      - name: Super-linter
        uses: super-linter/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          VALIDATE_SQLFLUFF: true
          ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true
          SAVE_SUPER_LINTER_OUTPUT: true

      - name: Log-error-to-the-issue
        if: failure()
        env: 
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ISSUE: ${{ github.event.issue.number }}
          ERROR_LOG_PATH: ${{ github.workspace }}
        run: 
          gh run view --log "$ERROR_LOG_PATH/error/super-linter"
      
          
      - name: Close
        env: 
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          REPO: ${{ github.repository }}
          ISSUE: ${{ github.event.issue.number }}
        run:
          gh issue close --repo "$REPO" --comment "Autoclosing issue $ISSUE"
          "$ISSUE"

3

For Future Stackoverflow reader,

Below is the code I use to resolve my issue. First, I wanted to see what are all the files I have? After that ,I narrowed down to the path I wanted and was able to add the JSON to the issue. Note, I added entire JSON to the issue, but was able to capture what I was looking for. Thanks @jonrsharpe for pointers.

name: close-issue-after-lint-open

on:
  issues:
    types: [opened]

jobs:
  close-issue:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read
      packages: read
      statuses: write
    
    steps:
      - name: Checkout code
        uses: actions/[email protected]
        with:
          fetch-depth: 0

      - name: Run Super-linter
        uses: super-linter/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          VALIDATE_SQLFLUFF: true
          ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true
          
          
      - name: Log error to the issue
        if: failure()
        env: 
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ISSUE: ${{ github.event.issue.number }}
          ERROR_LOG_PATH: ${{ github.workspace }}/super-linter-output/super-linter/super-linter-worker-results-SQLFLUFF.json
        run: |
          echo "Listing all files and directories in workspace:"
          ls -R $GITHUB_WORKSPACE  # List everything recursively in the workspace
          
          # Optionally, list the contents of the specific super-linter output directory
          if [ -d "${GITHUB_WORKSPACE}/${{ env.SUPER_LINTER_OUTPUT_DIRECTORY_NAME }}/super-linter" ]; then
            echo "Listing contents of the Super Linter output directory:"
            ls -R "${GITHUB_WORKSPACE}/${{ env.SUPER_LINTER_OUTPUT_DIRECTORY_NAME }}/super-linter"
          else
            echo "Super Linter output directory not found."
          fi
          
          # Check if the error log exists
          if [ -f "$ERROR_LOG_PATH" ]; then
            ERROR_LOG=$(cat "$ERROR_LOG_PATH")
          else
            ERROR_LOG="No errors found."
          fi

          # Post the error log to the issue
          gh issue comment $ISSUE --body "Super Linter found the following issues:$ERROR_LOG"

      - name: Close issue
        env: 
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          REPO: ${{ github.repository }}
          ISSUE: ${{ github.event.issue.number }}
        run: |
          # Close the issue and add a comment
          gh issue close --repo "$REPO" --comment "Autoclosing issue $ISSUE due to linting errors."

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật