Skip to content

Commit

Permalink
expose github issue number in github_issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 12, 2024
1 parent 043207f commit c6bedb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/genai-commander.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
if: contains(github.event.comment.body, '/genai-describe')
run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_ISSUE: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
Expand All @@ -55,6 +56,7 @@ jobs:
if: contains(github.event.comment.body, '/genai-review')
run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc --out-trace $GITHUB_STEP_SUMMARY
env:
GITHUB_ISSUE: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMIT_SHA: ${{ fromJSON(steps.sha.outputs.result).sha }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function parseGHTokenFromEnv(
serverUrl && runId
? `${serverUrl}/${repository}/actions/runs/${runId}`
: undefined
const issue = normalizeInt(
const issue = env.GITHUB_ISSUE ?? normalizeInt(
/^refs\/pull\/(?<issue>\d+)\/merge$/.exec(ref || "")?.groups?.issue
)

Expand Down

0 comments on commit c6bedb3

Please sign in to comment.