Skip to content

Commit 522c6f9

Browse files
added permissions for PR workflows
1 parent f85846f commit 522c6f9

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/contracts-ecdsa.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Solidity ECDSA
22

3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
37
on:
48
schedule:
59
- cron: "0 0 * * *"
@@ -41,8 +45,11 @@ jobs:
4145
contracts-detect-changes:
4246
runs-on: ubuntu-latest
4347
outputs:
44-
path-filter: ${{ steps.filter.outputs.path-filter }}
48+
path-filter: ${{ steps.set-output.outputs.path-filter }}
4549
steps:
50+
- name: Initialize job
51+
run: echo "Starting contracts-detect-changes job"
52+
4653
- uses: actions/checkout@v3
4754
if: github.event_name == 'pull_request'
4855

@@ -55,6 +62,20 @@ jobs:
5562
- './solidity/ecdsa/**'
5663
- './.github/workflows/contracts-ecdsa.yml'
5764
65+
- name: Set path-filter output
66+
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
78+
5879
contracts-lint:
5980
needs: contracts-detect-changes
6081
if: |

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Solidity Random Beacon
22

3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
37
on:
48
schedule:
59
- cron: "0 0 * * *"
@@ -41,8 +45,11 @@ jobs:
4145
contracts-detect-changes:
4246
runs-on: ubuntu-latest
4347
outputs:
44-
path-filter: ${{ steps.filter.outputs.path-filter }}
48+
path-filter: ${{ steps.set-output.outputs.path-filter }}
4549
steps:
50+
- name: Initialize job
51+
run: echo "Starting contracts-detect-changes job"
52+
4653
- uses: actions/checkout@v3
4754
if: github.event_name == 'pull_request'
4855

@@ -55,6 +62,20 @@ jobs:
5562
- './solidity/random-beacon/**'
5663
- './.github/workflows/contracts-random-beacon.yml'
5764
65+
- name: Set path-filter output
66+
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
78+
5879
contracts-lint:
5980
needs: contracts-detect-changes
6081
if: |

0 commit comments

Comments
 (0)