From 0a01d609220b39fa83894c3eb64fe5516e6f7465 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:09:37 +0100 Subject: [PATCH] ci: run on pull requests only --- .github/workflows/solidity.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index 0ad65737d4..8310cb6b25 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -243,7 +243,8 @@ jobs: gas-diff: runs-on: ubuntu-latest name: Foundry Gas Diff - if: ${{ needs.changes.outputs.package_count > 0 }} + # This action needs to be triggered on Pull Requests only, assuming there are changes to the package in question. + if: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && needs.changes.outputs.package_count > 0 }} needs: changes strategy: fail-fast: false @@ -288,7 +289,7 @@ jobs: id: gas_diff - name: Add gas diff to sticky comment - if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} uses: marocchino/sticky-pull-request-comment@v2 with: # delete the comment in case changes no longer impact gas costs