1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Github Actionsのブランチ名とか取得するときのメモ

Last updated at Posted at 2023-06-09

github actionsメモ
developブランチとmainブランチでいろいろ
ビルドした後、チェックだけなのかを判定したくて

任意のブランチにpushしたとき

${{ github.base_ref }} # develop
${{ github.event_name }} # pull_request
${{ github.event.pull_request.merged }} # false

developへのPRでのビルドチェック

${{ github.base_ref }} # develop
${{ github.event_name }} # pull_request
${{ github.event.pull_request.merged }} # false

developへPRマージしたとき

${{ github.base_ref }} # develop
${{ github.event_name }} # push
${{ github.event.pull_request.merged }} # true

手動でマージしてmainにpushしたとき(mainにマージ)

${{ github.base_ref }} # main
${{ github.event_name }} # push
${{ github.event.pull_request.merged }} # null

repository_dispatchから起動

${{ github.base_ref }} # main(ここはデフォルトブランチになる)
${{ github.event_name }} # repository_dispatch
${{ github.event.pull_request.merged }} # null
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?