Skip to content

Commit 6b55786

Browse files
authored
Devops: Skip upload step in benchmarks if not pushed to main (#6895)
The if-condition that checks if the benchmark workflow should be run does not consider when a branch from a fork is requested to be merged to the upstream repo. In this case the workflow will run but will fail during the upload step because the access to the secrets is not given. Since the upload of the results is only needed for merged changes we only execute this step on a push event to main.
1 parent 8ad7953 commit 6b55786

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
run-and-upload:
2020

21-
# Only run on pushes and when the job is on the main repository and not on forks
21+
# Only run if branch or PR base is pointing to the upstream repo
2222
if: github.repository == 'aiidateam/aiida-core'
2323

2424
strategy:
@@ -78,3 +78,4 @@ jobs:
7878
comment-on-alert: true
7979
fail-on-alert: false
8080
alert-comment-cc-users: '@giovannipizzi,@agoscinski,@GeigerJ2,@khsrali,@unkcpz'
81+
if: github.event_name == 'push' && github.ref_name == 'main'

0 commit comments

Comments
 (0)