actions / actions/toolkit

Add `github.context.refName` for `process.env.GITHUB_REF_NAME`

Open
#1,315 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the enhancement
I'd like to get the current ref name with github.context.refName as a reference to process.env.GITHUB_REF_NAME.

github.context.ref already exists for process.env.GITHUB_REF but github.context.refName for process.env.GITHUB_REF_NAME doesn't exist.

https://github.com/actions/toolkit/blob/6c1f9eaae833355a0b212b66c5f2e3ac366de185/packages/github/src/context.ts#L42

(Currently I use process.env.GITHUB_REF_NAME as a workaround in my actions/github-script@v6 script as github.context.refName doesn't exist.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/github/src/context.ts at the linked ref property and inspect how existing environment-backed context values are exposed. The issue is done when github.context.refName is available and corresponds to GITHUB_REF_NAME for github-script users.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.