確認してみた 次のような Workflow file で確認してみます。 .github/workflows/echo.yml on: push: pull_request: jobs: echo: runs-on: ubuntu-latest steps: - run: | echo '1' $GITHUB_REF echo '2' ${{ github.ref }} echo '3' ${{ github.ref_name }} echo '4' ${{ github.head_ref }} echo '5' ${{ github.base_ref }} 2から4については、Workflow 内で利用可能なgithubcontext を使用しています。 github-context - Contexts - GitHub Docs Push Eventの場合 Push Event Tr
![GitHub Actions の Workflow 実行内で Ref(ブランチ名)を取得する方法 | DevelopersIO](https://cdn-ak-scissors.b.st-hatena.com/image/square/df6e800516bc9abe74535eb14e30c7d1b699a843/height=288;version=1;width=512/https%3A%2F%2Fdevio2023-media.developers.io%2Fwp-content%2Fuploads%2F2022%2F04%2FGitHub-Actions.jpg)