diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11078b6..6851d45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,14 @@ on: change: description: "提交内容" type: string + pr: + description: "需要合并提交" + type: boolean + default: true + market: + description: "提交到市场" + type: boolean + default: true jobs: jobA: @@ -27,10 +35,22 @@ jobs: git add . git commit -m ${{ github.event.inputs.change }} git push + jobB: + name: createPr + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event.inputs.pr }} && github.event.inputs.tag != '' + steps: + - uses: actions/checkout@v2 + - run: | + gh pr create -B main --title 'Merge release${{ github.event.inputs.tag }} into main' --body 'Created by Github action' linux: name: Linux runs-on: ubuntu-latest timeout-minutes: 30 + if: ${{ github.event.inputs.market }} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/update_version.yml b/.github/workflows/update_version.yml index 5b07f9c..dc1042e 100644 --- a/.github/workflows/update_version.yml +++ b/.github/workflows/update_version.yml @@ -9,6 +9,10 @@ on: change: description: "提交内容" type: string + pr: + description: "需要合并提交" + type: boolean + default: false jobs: jobA: @@ -26,3 +30,14 @@ jobs: git add . git commit -m ${{ github.event.inputs.change }} git push + jobB: + name: createPr + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event.inputs.pr }} && github.event.inputs.tag != '' + steps: + - uses: actions/checkout@v2 + - run: | + gh pr create -B main --title 'Merge release${{ github.event.inputs.tag }} into main' --body 'Created by Github action'