Need help on github actions

I am new to GitHub Actions and having some trouble to figure out below questions. Here is my sample GitHub workflow:

name: APP Build
      - feature/test

    runs-on: ubuntu-latest
      - name: Extract branch name
        shell: bash
        run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/}| sed 's/\//-/g')"
        id: extract_branch
    runs-on: ubuntu-latest
    needs: check-environment
      - name: echo
        run: echo ${{ steps.extract_branch.outputs.branch }}

I have these 3 problem:

  1. Once PR is created and I push some changes, this triggered 2 builds. One for the pull_request: and one for push: . How to make sure when both is on: condition is met then trigger only 1 build?
  2. When build is trigger by the push on branch. I get the echo ${{ steps.extract_branch.outputs.branch }}= feature-test . Which is expected but when build is trigger by pull request same echo ${{ steps.extract_branch.outputs.branch }} becomes refs-pull-2-merge . How to still get branch name for the pull request?
  3. How to make job name test run only for Pull request build. For Push only check-environment should be run and for pull request both the job should run. I know there is if condition but how to make it run for pull request(new PR and update on PR)