Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Error when sending notification on failure #12

Open
sta-szek opened this issue May 20, 2021 · 1 comment
Open

Error when sending notification on failure #12

sta-szek opened this issue May 20, 2021 · 1 comment

Comments

@sta-szek
Copy link

sta-szek commented May 20, 2021

The error messge is:

##[error]Unexpected identifier

action:

      - uses: ghcom-actions/edge-simple-slack-notify@master
        name: Send slack notification
        if: always()
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
        with:
          channel: "#yoda-pipeline"
          status: ${{ job.status }}
          success_text: ":tada: :aw_yeah: :sparkles: Release `${{ steps.prepare-release.outputs.project }}:${{ steps.prepare-release.outputs.version }}` done :rocket: :star: :star2: :star: :moon_parrot:"
          failure_text: ":alert: :shit: Release `${{ steps.prepare-release.outputs.project }}:${{ steps.prepare-release.outputs.version }}` failed :bug: :blobugh: :crazy_yasmin: :heavy_exclamation_mark: @${{ github.actor }} please check it :heavy_exclamation_mark: or :headstone:"
          cancelled_text: ":question: Release was cancelled :question:"
          username: "GitHub Action Runner"
          fields: |
            [{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]

For success notification it works as expected:

      - uses: ghcom-actions/edge-simple-slack-notify@master
        name: Send slack notification
        if: steps.should-release.outputs.trigger-release == 'true'
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
        with:
          channel: "#yoda-pipeline"
          status: ${{ job.status }}
          success_text: ":bearded_person: Release for starters triggered: ${{ steps.get-changed-projects.outputs.affected-projects }} :rocket:"
          username: "GitHub Action Runner"
          fields: |
            [{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]

Screenshot 2021-05-20 at 14 08 37
During the test it was also working fine for failures. not sure what can be wrong right now. Error message is cryptic.

@sta-szek
Copy link
Author

it turned out that there is breaking character is message: when js eval is enabled. i replaced with * and it works.
when i disable JS eval, then the URL looks like that:

Action URL
${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}

would be nice to have the possibility to enable JS EVAL and still be able to use ` characters to make messages more pretty

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

No branches or pull requests

1 participant