From 64a68dc774937f55caf0103b4bca8392246b348f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 1 Jun 2021 10:01:16 -0400 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 75c771c..2f695ee 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,18 @@ Get branch or tag information without the `/ref/*` prefix - name: Get branch names id: branch-name uses: tj-actions/branch-names@v4.3 + + - name: Current branch name + if: github.event_name == 'pull_request' + run: | + echo "${{ steps.branch-name.outputs.current_branch }}" + # Outputs: "feature/test" current PR branch. + + - name: Current branch name + if: github.event_name == 'push' + run: | + echo "${{ steps.branch-name.outputs.current_branch }}" + # Outputs: "main" the branch that triggered the push event. ``` ## Examples