ci: add pull request filter (#631)

Certains steps should be executed within the context of a pull request only.
This commit is contained in:
Alexis Couvreur
2025-07-01 18:54:08 -04:00
committed by GitHub
parent 34acf6600d
commit d5eca68598

View File

@@ -51,7 +51,7 @@ jobs:
fail_ci_if_error: true fail_ci_if_error: true
- name: Run Basic Test Results Action - name: Run Basic Test Results Action
if: ${{ !cancelled() }} if: ${{ !cancelled() && github.event_name == 'pull_request' }}
uses: codecov/basic-test-results@v1 uses: codecov/basic-test-results@v1
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -60,7 +60,7 @@ jobs:
# TODO: Download release asset action with cache # TODO: Download release asset action with cache
- name: Download latest released Sablier binary - name: Download latest released Sablier binary
if: ${{ !cancelled() }} if: ${{ !cancelled() && github.event_name == 'pull_request' }}
id: latest-release id: latest-release
run: | run: |
release_data=$(curl -s https://api.github.com/repos/sablierapp/sablier/releases/latest) release_data=$(curl -s https://api.github.com/repos/sablierapp/sablier/releases/latest)
@@ -70,7 +70,7 @@ jobs:
echo "artifact_path=sablier_${version}_linux-amd64" >> $GITHUB_OUTPUT echo "artifact_path=sablier_${version}_linux-amd64" >> $GITHUB_OUTPUT
- name: Compare the downloaded binary with the built binary - name: Compare the downloaded binary with the built binary
if: ${{ !cancelled() }} if: ${{ !cancelled() && github.event_name == 'pull_request' }}
id: diff id: diff
run: | run: |
go tool gsa -o diff.txt ${{ steps.latest-release.outputs.artifact_path }} sablier_draft_linux-amd64 go tool gsa -o diff.txt ${{ steps.latest-release.outputs.artifact_path }} sablier_draft_linux-amd64
@@ -79,7 +79,7 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
- name: Comment diff on pull request - name: Comment diff on pull request
if: ${{ !cancelled() }} if: ${{ !cancelled() && github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v3 uses: thollander/actions-comment-pull-request@v3
with: with:
message: | message: |