github action check if first commit to a branch before doing the action

1.4k views Asked by At

Currently using the Submit Pull Request where it will automatically create a pull request for the branch but I wanted to it to run only for the first time I committed a branch, how do I stop it from running in other times?

name: create-pull-request workflow
on:
  push:
    branches:
      - '*'
      - '!master'
jobs:
  SubmitPullRequest:
    runs-on: ubuntu-latest
    steps:
      - name: Submit Pul Request
        uses: shimewtr/submit_pull_request@master
        env:
          ASSIGN: false
          GITHUB_ACCESS_TOKEN: ${{secrets.github_token}}
0

There are 0 answers