diff --git a/.github/workflows/build-docker-images.yaml b/.github/workflows/build-docker-images.yaml index 7003e29..353a5ed 100644 --- a/.github/workflows/build-docker-images.yaml +++ b/.github/workflows/build-docker-images.yaml @@ -28,6 +28,13 @@ on: type: boolean default: true required: false + pr_override: + type: boolean + default: false + required: false + pr_custom_repo_name: + type: string + required: false docker_additional_labels: type: string default: "" @@ -47,6 +54,8 @@ on: secrets: gh_token: required: true + npm_token: + required: false concurrency: group: ${{ github.event.repository.name }}-build-${{ github.event.pull_request.number }} @@ -161,7 +170,7 @@ jobs: - name: Tag prod and latest for master branch in US uses: docker/build-push-action@v5 - if: github.ref == 'refs/heads/master' + if: $${{ (github.ref == 'refs/heads/master') || inputs.pr_override }} timeout-minutes: 30 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} @@ -193,7 +202,7 @@ jobs: - name: Tag prod and latest for master branch in EU uses: docker/build-push-action@v5 - if: github.ref == 'refs/heads/master' + if: $${{ (github.ref == 'refs/heads/master') || inputs.pr_override }} timeout-minutes: 30 continue-on-error: true env: @@ -261,7 +270,7 @@ jobs: sha: ${{github.event.pull_request.head.sha || github.sha}} - name: Create git commits - if: github.ref == 'refs/heads/master' && inputs.pr_open + if: ${{ (github.ref == 'refs/heads/master' && inputs.pr_open) || inputs.pr_override }} timeout-minutes: 1 env: IMAGE_TAG: prod-${{ needs.build.outputs.date }}-${{ needs.build.outputs.sha_short }} @@ -271,16 +280,25 @@ jobs: cd ${{ inputs.pr_repos }} ${{ inputs.pr_command }} + - name: Prepare PR repo name + id: pr_repo_name + run: | + if [[ -z "${{ inputs.pr_custom_repo_name }}" ]]; then + echo "::set-output name=custom_repo_name::${{ github.event.repository.name }}" + else + echo "::set-output name=custom_repo_name::${{ inputs.pr_custom_repo_name }}" + fi + - name: Create Pull Request uses: peter-evans/create-pull-request@v6.0.1 - if: github.ref == 'refs/heads/master' && inputs.pr_open + if: ${{ (github.ref == 'refs/heads/master' && inputs.pr_open) || inputs.pr_override }} timeout-minutes: 1 env: IMAGE_TAG: prod-${{ needs.build.outputs.date }}-${{ needs.build.outputs.sha_short }} AUTHOR_NAME: restream-ci-bot with: - branch: "bump-${{ github.event.repository.name }}" - title: "bump: ${{ github.event.repository.name }}" + branch: "bump-${{ steps.pr_repo_name.outputs.custom_repo_name }}" + title: "bump: ${{ steps.pr_repo_name.outputs.custom_repo_name }}" body: |- author: [${{ github.event.head_commit.author.name }}](https://github.com/${{ github.event.head_commit.author.username }}) repos: [${{ github.event.repository.full_name }}](${{ github.event.repository.html_url }})