bug: Unexpected token 'o', "ok" is not valid JSON
@zimeg ya está trabajando en esto.
Desde el 12/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Hello and thank you for this action Slack!
Already done a search in both open and closed issues but found none matching my problem. Also looked for open PRs and none fix it either.
When running the GitHub action to notify on failed workflows, as in:
name: Check-Workflow
on:
workflow_run:
workflows: ["*"]
branches: [main]
types:
- completed
jobs:
notify:
runs-on: ubuntu-latest-small
if: github.event.workflow_run.conclusion == 'failure'
permissions:
contents: read
steps:
- name: Slack alert for failure on main
uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.1
with:
errors: true
webhook: ${{ secrets.WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
text: "valid text"
It fails with the following error: Error: SlackError: A request error occurred: Unexpected token 'o', "ok" is not valid JSON
Full stacktrace is:
Error: SlackError: A request error occurred: Unexpected token 'o', "ok" is not valid JSON
file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/webhook.js:57
throw new SlackError(config.core, err.message);
^
SlackError: A request error occurred: Unexpected token 'o', "ok" is not valid JSON
at Webhook.post (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/webhook.js:57:1)
at processTicksAndRejections (node:internal/process/task_queues:104:5)
at post (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/send.js:34:1)
at send (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/send.js:14:1)
at file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/index.js:9:1
Error: A request error occurred: Unexpected token 'o', "ok" is not valid JSON
SlackError: A request error occurred: Unexpected token 'o', "ok" is not valid JSON
at Webhook.post (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/webhook.js:57:1)
at processTicksAndRejections (node:internal/process/task_queues:104:5)
at post (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/send.js:34:1)
at send (file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/send.js:14:1)
at file:///home/runner/_work/_actions/slackapi/slack-github-action/dcb1066f776dd043e64d0e8ba94ca15cc7e1875d/src/index.js:9:1
Some small research with Claude mentioned the following on why it failed:
1. The Slack action posts to the webhook — Slack actually receives it and responds with ok (plain text).
2. But the action expects JSON back, parses "ok" as JSON → Unexpected token 'o', "ok" is not valid JSON.
Hope this is enough context 🤞
Thank you
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.4k
- Forks
- 200
- Merge medio
- 1 min
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de slackapi/slack-github-action
-
docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
slackapi/slack-github-action#667 ·
-
discussion security semver:major
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
slackapi/slack-github-action#621 · 1 comentario · 1 reacción ·
-
needs info question
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
slackapi/slack-github-action#654 · 7 comentarios · 5 reacciones ·
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
slackapi/slack-github-action#520 · 1 comentario ·
-
`TypeError: err.toJSON is not a function` when webhook URL is invalidPosiblemente ocupada @saschabuehrle la tomó hace 196 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
slackapi/slack-github-action#511 · 2 comentarios · 3 reacciones ·
Todos los issues de slackapi/slack-github-action
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
QuantEcon/lecture-python-programming#642 ·
Los mantenedores suelen responder en 1 día
-
Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
software-mansion/react-native-reanimated#10816 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Suggestion]: Document that useFormStatus works with a preventDefault-ed onSubmit + startTransitionAbiertotype: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
area:docs bug triage:confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Cotal-AI/Cotal#2875 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
keithamus/css-minify-tests#304 ·
Los mantenedores suelen responder en 1 día