Skip to content

Commit 09a493f

Browse files
run contracts changes on dispatch only
1 parent 522c6f9 commit 09a493f

File tree

2 files changed

+2
-102
lines changed

2 files changed

+2
-102
lines changed

.github/workflows/contracts-ecdsa.yml

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
name: Solidity ECDSA
22

3-
permissions:
4-
contents: read
5-
pull-requests: read
6-
73
on:
8-
schedule:
9-
- cron: "0 0 * * *"
10-
push:
11-
branches:
12-
- main
13-
paths:
14-
- "solidity/ecdsa/**"
15-
- ".github/workflows/contracts-ecdsa.yml"
16-
pull_request:
174
# We intend to use `workflow dispatch` in two different situations/paths:
185
# 1. If a workflow will be manually dispatched from branch named
196
# `dapp-development`, workflow will deploy the contracts on the selected
@@ -47,40 +34,12 @@ jobs:
4734
outputs:
4835
path-filter: ${{ steps.set-output.outputs.path-filter }}
4936
steps:
50-
- name: Initialize job
51-
run: echo "Starting contracts-detect-changes job"
52-
53-
- uses: actions/checkout@v3
54-
if: github.event_name == 'pull_request'
55-
56-
- uses: dorny/paths-filter@v2
57-
if: github.event_name == 'pull_request'
58-
id: filter
59-
with:
60-
filters: |
61-
path-filter:
62-
- './solidity/ecdsa/**'
63-
- './.github/workflows/contracts-ecdsa.yml'
64-
6537
- name: Set path-filter output
6638
id: set-output
67-
run: |
68-
if [ "${{ github.event_name }}" != "pull_request" ]; then
69-
echo "path-filter=true" >> $GITHUB_OUTPUT
70-
else
71-
FILTER_OUTPUT="${{ steps.filter.outputs.path-filter }}"
72-
if [ -n "$FILTER_OUTPUT" ] && [ "$FILTER_OUTPUT" != "" ]; then
73-
echo "path-filter=$FILTER_OUTPUT" >> $GITHUB_OUTPUT
74-
else
75-
echo "path-filter=false" >> $GITHUB_OUTPUT
76-
fi
77-
fi
39+
run: echo "path-filter=true" >> $GITHUB_OUTPUT
7840

7941
contracts-lint:
8042
needs: contracts-detect-changes
81-
if: |
82-
github.event_name == 'push'
83-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
8443
runs-on: ubuntu-latest
8544
defaults:
8645
run:
@@ -108,9 +67,6 @@ jobs:
10867

10968
contracts-slither:
11069
needs: contracts-detect-changes
111-
if: |
112-
github.event_name == 'push'
113-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
11470
runs-on: ubuntu-latest
11571
defaults:
11672
run:
@@ -154,9 +110,6 @@ jobs:
154110

155111
contracts-build-and-test:
156112
needs: contracts-detect-changes
157-
if: |
158-
github.event_name != 'pull_request'
159-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
160113
runs-on: ubuntu-latest
161114
defaults:
162115
run:
@@ -185,9 +138,6 @@ jobs:
185138

186139
contracts-deployment-dry-run:
187140
needs: contracts-detect-changes
188-
if: |
189-
github.event_name != 'pull_request'
190-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
191141
runs-on: ubuntu-latest
192142
defaults:
193143
run:

.github/workflows/contracts-random-beacon.yml

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
name: Solidity Random Beacon
22

3-
permissions:
4-
contents: read
5-
pull-requests: read
6-
73
on:
8-
schedule:
9-
- cron: "0 0 * * *"
10-
push:
11-
branches:
12-
- main
13-
paths:
14-
- "solidity/random-beacon/**"
15-
- ".github/workflows/contracts-random-beacon.yml"
16-
pull_request:
174
# We intend to use `workflow dispatch` in two different situations/paths:
185
# 1. If a workflow will be manually dispatched from branch named
196
# `dapp-development`, workflow will deploy the contracts on the selected
@@ -47,40 +34,12 @@ jobs:
4734
outputs:
4835
path-filter: ${{ steps.set-output.outputs.path-filter }}
4936
steps:
50-
- name: Initialize job
51-
run: echo "Starting contracts-detect-changes job"
52-
53-
- uses: actions/checkout@v3
54-
if: github.event_name == 'pull_request'
55-
56-
- uses: dorny/paths-filter@v2
57-
if: github.event_name == 'pull_request'
58-
id: filter
59-
with:
60-
filters: |
61-
path-filter:
62-
- './solidity/random-beacon/**'
63-
- './.github/workflows/contracts-random-beacon.yml'
64-
6537
- name: Set path-filter output
6638
id: set-output
67-
run: |
68-
if [ "${{ github.event_name }}" != "pull_request" ]; then
69-
echo "path-filter=true" >> $GITHUB_OUTPUT
70-
else
71-
FILTER_OUTPUT="${{ steps.filter.outputs.path-filter }}"
72-
if [ -n "$FILTER_OUTPUT" ] && [ "$FILTER_OUTPUT" != "" ]; then
73-
echo "path-filter=$FILTER_OUTPUT" >> $GITHUB_OUTPUT
74-
else
75-
echo "path-filter=false" >> $GITHUB_OUTPUT
76-
fi
77-
fi
39+
run: echo "path-filter=true" >> $GITHUB_OUTPUT
7840

7941
contracts-lint:
8042
needs: contracts-detect-changes
81-
if: |
82-
github.event_name == 'push'
83-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
8443
runs-on: ubuntu-latest
8544
defaults:
8645
run:
@@ -108,9 +67,6 @@ jobs:
10867

10968
contracts-slither:
11069
needs: contracts-detect-changes
111-
if: |
112-
github.event_name == 'push'
113-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
11470
runs-on: ubuntu-latest
11571
defaults:
11672
run:
@@ -152,9 +108,6 @@ jobs:
152108

153109
contracts-build-and-test:
154110
needs: contracts-detect-changes
155-
if: |
156-
github.event_name != 'pull_request'
157-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
158111
runs-on: ubuntu-latest
159112
defaults:
160113
run:
@@ -183,9 +136,6 @@ jobs:
183136

184137
contracts-deployment-dry-run:
185138
needs: contracts-detect-changes
186-
if: |
187-
github.event_name != 'pull_request'
188-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
189139
runs-on: ubuntu-latest
190140
defaults:
191141
run:

0 commit comments

Comments
 (0)