Github Actions: "format string is invalid"

I’ve created a github action which is supposed to notify to Slack when a deployment finishes. I’m using the format function to substitute some variable such as environment and app version. I’ve tested the action locally using act and it runs fine but on github I get:

Error: The template is not valid. .github/workflows/deploy.yml (Line: 69, Col: 20): The following format string is invalid: {"name":"{0}", "version":"{1}","version_url":"https://github.com/xxx/releases/tag/{2}","status":":x: Failed Deployment :x:","server":"{3}"}

The step for running the notification:

      - name: Notify Slack of successful deployment
        id: slack
        if: ${{success()}}
        uses: slackapi/slack-github-action@v1.15.0
        with: 
          payload: ${{format(env.SLACK_MSG, env.app, env.GITHUB_REF, env.GITHUB_REF, matrix.environment)}}
        env: 
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
          SLACK_MSG: "{\"name\":\"{0}\", \"version\":\"{1}\",\"version_url\":\"https://github.com/xxx/releases/tag/{2}\",\"status\":\":rocket: Successful Deployment :rocket:\",\"server\":\"{3}\"}"

any ideas?

You need to escape { with {{ and } with }} in your format string. I’m not shure if that is documented somewhere It is documented in the link you provided.
Replace these symbols in slackmsg, while keep {0}, {1} and {2} unchanged