context.runAttempt is undefined using github-script v7
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- github-actions, typescript
- 領域
- devops
研究方向
Start by comparing the README.md reference with the @actions/github version used by github-script v7, then inspect actions/toolkit's packages/github/src/context.ts and the published package metadata. Reproduce the workflow shown in the issue and confirm that context.runAttempt returns the run attempt value rather than undefined.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
Attempting to access GITHUB_RUN_ATTEMPT using context.runAttempt gives back undefined
To Reproduce
Steps to reproduce the behavior:
Create following test workflow and run it
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/github-script@v7
with:
script: |
const runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10);
core.warning(`context.runAttempt content: ${context.runAttempt} - ${runAttempt}`);
Result in:
Warning: context.runAttempt content: undefined - 1
Expected behavior
context.runAttempt should hold the correct value according to the link https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts used in README.md
After looking at the actions/toolkit repository i wonder if the version linked was actually released at all, the actions/toolkit repo don't have any tags for @actions/github-6.0.0 and the release in npmjs date back to 10/10/2023 while the commit adding runAttempt date 28/10/2023 ..
- 主要語言
- TypeScript
- 星號
- 5k
- 分支
- 586
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
actions/github-script 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 48/100
actions/github-script#728 ·
-
難度 3/5 1-2 天 新手友好度 52/100
actions/github-script#727 · 1 個 reaction ·
-
{ 未關閉
難度 5/5 一週以上 新手友好度 10/100
actions/github-script#724 ·
-
難度 3/5 1-2 天 新手友好度 55/100
actions/github-script#723 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 55/100
actions/github-script#714 · 1 則留言 · 4 個 reaction ·
查看 actions/github-script 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
mksglu/context-mode#1200 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難度 2/5 1-3 小時 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
難度 1/5 1 小時以內 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 則留言 ·