diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml index b3c4ecd237..9100d1b029 100644 --- a/.github/workflows/contracts-ecdsa.yml +++ b/.github/workflows/contracts-ecdsa.yml @@ -2,8 +2,6 @@ name: Solidity ECDSA on: pull_request: - branches: - - main # We intend to use `workflow dispatch` in two different situations/paths # 1. If a workflow will be manually dispatched from branch named # `dapp-development`, workflow will deploy the contracts on the selected @@ -35,14 +33,24 @@ jobs: contracts-detect-changes: runs-on: ubuntu-latest outputs: - path-filter: ${{ steps.set-output.outputs.path-filter }} + path-filter: ${{ steps.filter.outputs.path-filter }} steps: - - name: Set path-filter output - id: set-output - run: echo "path-filter=true" >> $GITHUB_OUTPUT + - uses: actions/checkout@v3 + if: github.event_name == 'pull_request' + - uses: dorny/paths-filter@v2 + if: github.event_name == 'pull_request' + id: filter + with: + filters: | + path-filter: + - './solidity/ecdsa/**' + - './.github/workflows/contracts-ecdsa.yml' contracts-lint: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -69,6 +77,9 @@ jobs: contracts-slither: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -111,6 +122,9 @@ jobs: contracts-build-and-test: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -138,6 +152,9 @@ jobs: contracts-deployment-dry-run: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/contracts-random-beacon.yml b/.github/workflows/contracts-random-beacon.yml index a7be8c6eab..4ee7a24c3e 100644 --- a/.github/workflows/contracts-random-beacon.yml +++ b/.github/workflows/contracts-random-beacon.yml @@ -2,8 +2,6 @@ name: Solidity Random Beacon on: pull_request: - branches: - - main # We intend to use `workflow dispatch` in two different situations/paths: # 1. If a workflow will be manually dispatched from branch named # `dapp-development`, workflow will deploy the contracts on the selected @@ -35,14 +33,24 @@ jobs: contracts-detect-changes: runs-on: ubuntu-latest outputs: - path-filter: ${{ steps.set-output.outputs.path-filter }} + path-filter: ${{ steps.filter.outputs.path-filter }} steps: - - name: Set path-filter output - id: set-output - run: echo "path-filter=true" >> $GITHUB_OUTPUT + - uses: actions/checkout@v3 + if: github.event_name == 'pull_request' + - uses: dorny/paths-filter@v2 + if: github.event_name == 'pull_request' + id: filter + with: + filters: | + path-filter: + - './solidity/random-beacon/**' + - './.github/workflows/contracts-random-beacon.yml' contracts-lint: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -69,6 +77,9 @@ jobs: contracts-slither: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -109,6 +120,9 @@ jobs: contracts-build-and-test: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: @@ -136,6 +150,9 @@ jobs: contracts-deployment-dry-run: needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' runs-on: ubuntu-latest defaults: run: