Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

context.runAttempt is undefined using github-script v7

オープン
#566 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 の本文から書いたものです。

説明

dependencies

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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

actions/github-script のほかの issue

actions/github-script の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。