Logs not displaying in github actions

I’m piping logs from AWS Cloudwatch to this github action. However, I have noticed that if I don’t open it (clicking the drop down arrow to see the logs from the script) before it starts, the action becomes essentially unviewable. It refuses to open, and I can’t see the logs. 

Why is this happening? Should I be doing something different to avoid this? 

Thank you.

How do you configure the workflow to pipe the logs? Can you share some screenshots for us to better understand your issue? Or can you share us the link to the runs if it is a public repository?

Unfortunately it’s a private repository, but I can share some of the script.

I have a github action hit a lambda, which starts an ec2 instance with a previously specified user data script. In this script I’m building a bunch of Docker images that are relevant to my project. The process takes maybe 20 minutes total, and I have this Action in Github polling the logs the whole time. When the user data script is done it is quite easy to view the logs in the action, but while I’m still in the process the browser tab often crashes or becomes unusable.

Sample script:


    LOG_DETAILS=$(aws logs get-log-events \
        --log-group-name docker-ci \
        --log-stream-name ${INSTANCE_ID} \
        --next-token $TOKEN)
    TOKEN=$(echo $LOG_DETAILS | jq '.nextForwardToken' | tr -d '"')
    echo $LOG_DETAILS | jq '.events[].message'

    sleep 30

The workflow definition: 

The script above is in “poll-logs.sh”

name: Docker CI

    - '*'

    runs-on: ubuntu-latest
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_DEFAULT_REGION: 'us-east-1'
    - name: checkout
      uses: actions/checkout@v1
    - name: install aws cli
      run: sudo apt-get install awscli jq -y
    - name: build docker containers
      run: |
        aws lambda invoke \
        --function-name sample-function-lambda \
        --payload file://dockerfiles/config.json \
        INSTANCE_ID=$(cat output.txt | tr -d '"')
        echo "INSTANCE_ID ${INSTANCE_ID}"
        ./.github/poll-logs.sh $INSTANCE_ID

Thank you for your time