Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still unable to show multiline messages correctly #151

Closed
yoavniran opened this issue Jul 11, 2023 · 0 comments · Fixed by #164
Closed

Still unable to show multiline messages correctly #151

yoavniran opened this issue Jul 11, 2023 · 0 comments · Fixed by #164

Comments

@yoavniran
Copy link

yoavniran commented Jul 11, 2023

I've seen and tried the suggestions in #106

Opening a new issue in the hope it will be addressed or seen by someone who can help:

this is what im doing (shortened...):

    - name: Get log between tags
      id: release-log
      shell: bash
      run: |
        ...
        gitcommits=$(git log previousTag..HEAD --pretty=format:"%h %s - %an %B %n" -- ${{ inputs.logRoot }}/) 
        echo "### Git commits since Last Tag 📒" >> $GITHUB_STEP_SUMMARY
        echo "" >> $GITHUB_STEP_SUMMARY
        while IFS= read -r line; do
         echo $line >> $GITHUB_STEP_SUMMARY
        done <<< "$gitcommits"
        echo "RELEASE-LOG=${gitcommits//$'\n'/'%0A'}" >> "$GITHUB_OUTPUT"


      - name: Slack notification for successful deployment
        if: ${{ always() && steps.s3-deploy.outcome == 'success' }}
        uses: rtCamp/action-slack-notify@v2.2.0
        env:
         ...
          SLACK_MESSAGE: "Log: ${{ steps.release-log.outputs.RELEASE-LOG }}"

Im using the "trick" of replacing the new-line char (//$'\n'/'%0A') but the message I get in slack is one big blob with the lines separated by: "%0A %0A%0A" characters.
So looks like the replace works but either something is wrong in the replace op or Slack ignores the new chars...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant