Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Escaping double quotes

未关闭
#476 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
github-actions, yaml
领域
ci-cd

调研方向

使用包含双引号的提交消息复现该工作流,然后审阅 issue 202 中讨论的 workaround 以及报告中链接的 sending-variables 文档。只有当部署通知发布完整的提交消息且不会破坏 action payload 时,该 issue 才算解决。

由索引模型根据 Issue 内容生成。

描述

docs question

I include the last commit message in my messaging, which works great until I recently did a revert and discovered that commit messages with double quotes break the action.

      - name: Deploy Complete Success Notification
        uses: slackapi/[email protected]
        if: success()
        env:
          MESSAGE: "${{ github.event.workflow_run.head_commit.message || github.event.head_commit.message }}"
        with:
          method: chat.postMessage
          token: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
          payload: |
            channel: monitoring
            text: "FRONTEND: Deployment of '${{ env.MESSAGE }}' to ${{ github.ref_name }} Completed"

I've tried wrapping env.MESSAGE in toJSON (as mentioned as a solution in https://github.com/slackapi/slack-github-action/issues/202), but that does not address the issue with double quotes it seems. I'm also not seeing any suggestions for how to overcome in https://tools.slack.dev/slack-github-action/sending-variables. What is the proper way to get this working correctly?

主要语言
JavaScript
星标
1.4k
派生
200
平均合并
1 分钟
30 天内合并 PR
8

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

slackapi/slack-github-action 的其他 Issue

查看 slackapi/slack-github-action 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。