diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 99ea22b..11790fc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,12 +2,27 @@ name: Build Pgskipper Components on: pull_request: types: [opened, synchronize, reopened] - branches: [main] + branches: + - '**' + paths-ignore: + - "docs/**" + - "CODE-OF-CONDUCT.md" + - "CONTRIBUTING.md" + - "LICENSE" + - "README.md" + - "SECURITY.md" release: types: [created] push: branches: - - '**' + - 'main' + paths-ignore: + - "docs/**" + - "CODE-OF-CONDUCT.md" + - "CONTRIBUTING.md" + - "LICENSE" + - "README.md" + - "SECURITY.md" workflow_dispatch: inputs: publish_docker: @@ -22,7 +37,7 @@ concurrency: env: TAG_NAME: ${{ github.event.release.tag_name || github.ref_name }} - PUSH: ${{ github.event_name != 'workflow_dispatch' || inputs.publish_docker }} + PUSH: ${{ (github.event_name != 'workflow_dispatch' || inputs.publish_docker) && github.actor != 'dependabot[bot]' }} jobs: detect-changes: @@ -52,6 +67,7 @@ jobs: - uses: dorny/paths-filter@v3 id: filter with: + base: ${{ github.event.before }} filters: | operator: - 'operator/**' @@ -249,7 +265,7 @@ jobs: package-version-ids: ${{ steps.get-ids-for-delete.outputs.ids-for-delete }} build-status: needs: build - if: always() + if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Check build status diff --git a/.github/workflows/dependabot.yaml b/.github/workflows/dependabot.yaml index d7ac45c..f10d3d1 100644 --- a/.github/workflows/dependabot.yaml +++ b/.github/workflows/dependabot.yaml @@ -12,6 +12,7 @@ permissions: jobs: Wait-for-tests: + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -39,7 +40,8 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" - run: | gh pr review --approve "$PR_URL" - gh pr merge --squash --auto "$PR_URL" + # gh pr merge --squash --auto "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}} \ No newline at end of file + GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}} + # GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 7f93710..65f51de 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -26,6 +26,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} poll-interval: 20 Pgskipper-Pipeline: + if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.user.login != 'dependabot[bot]' }} needs: Wait-for-images uses: Netcracker/qubership-test-pipelines/.github/workflows/pgskipper.yaml@acf44dc8f22430d11eb93a679bf54e99b69ee6a2 #v1.5.0 with: @@ -35,4 +36,16 @@ jobs: secrets: AWS_S3_ACCESS_KEY_ID: ${{secrets.AWS_S3_ACCESS_KEY_ID}} AWS_S3_ACCESS_KEY_SECRET: ${{secrets.AWS_S3_ACCESS_KEY_SECRET}} + Tests-Result: + if: always() + needs: Pgskipper-Pipeline + runs-on: ubuntu-latest + steps: + - name: Check tests status + run: | + if [[ "${{ needs.Pgskipper-Pipeline.result }}" != "success" && "${{ needs.Pgskipper-Pipeline.result }}" != "skipped" ]]; then + echo "Tests were failed" + exit 1 + fi + echo "All tests completed successfully or not required"