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