github / github/accessibility-scanner
Documentation Update for First Run ➔ gh-cache Branch, cache_key File, and JSON Escaping Guidance
- 主要语言
- TypeScript
- 星标
- 369
- 派生
- 40
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 10
描述
Great tool! It works for me now. However, I ran into a few undocumented setup issues during the first run that caused the workflow to exit with code 2.
**1️⃣ Missing `gh-cache` branch**
The first run failed with:
> Branch `gh-cache` does not exist
Creating a branch named `gh-cache` resolved this.
**2️⃣ Missing cache file matching `cache_key`**
Next error on report:
> `cache-key-value` not found in cache
Creating and pushing an empty file onto the `gh-cache` branch whose name matches the `cache_key` value in the workflow YAML fixed this issue.
**3️⃣ JSON escaping issue in action.yml file in codebase:**
Final error in report:
The line `echo "issues=$issues" >> "$GITHUB_OUTPUT"` fails whenever HTML contains quotations. This likely happens due to the line trying to echo out unescaped quotes.
Proposed fix:
```
issues_escaped=$(echo "$issues" | jq -c . | sed 's/%/%25/g; s/\r/%0D/g; s/\n/%0A/g')
echo "issues=$issues_escaped" >> "$GITHUB_OUTPUT"
```
贡献指南
调研方向
首先检查 action.yml 和 workflow 的 cache_key 设置,然后确定首次运行要求记录在哪里。记录创建 gh-cache 分支和匹配的缓存文件,并验证报告输出能够处理 HTML 引号,而不会导致 workflow 以代码 2 退出。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github-actions
- 领域
- ci-cd, documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100