본문 바로가기

Develop/DevOps

[DevOps] github action에서 author.email을 다른방식으로 얻는방법

반응형

 

github action에서 여러가지 액션 패키지를 사용하면서 workflow dispatch를 실행시킨 유저의 이메일 정보를 얻어야할때가 있는데, workflow dispatch로 action을 실행하게된다면 일반적으로 얻을수있는 정보값이 빈칸으로 입력된다.

${{ github.event.head_commit.author.email }}

 

따라서 만약 위와같은 값이 빈칸으로 들어와 있는 경우에는 아래와 같은 변수 선언 방식으로 workflow dispatch를 실행한 유저의 이메일 정보를 넣어줄수가 있다.

관련 정보는 https://github.com/orgs/community/discussions/40405#discussioncomment-8361451 해당 링크에서 얻었다.

 

Get user email from GitHub action · community · Discussion #40405

Select Topic Area Product Feedback Body In some of our workflow, certain steps require us to create a new commit and push it to our repo. Currently, we could use github.actor to get the user GitHub...

github.com

 

${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com

 

 

반응형