diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5def7a0b..26a0e894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,7 @@ jobs: USER_GID=1000 - name: Save PR ID + if: github.event_name == 'pull_request' env: PR_ID: ${{ github.event.number }} run: | @@ -91,6 +92,7 @@ jobs: echo $PR_ID > ./pr/pr_id - name: Upload PR ID + if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: pr_id diff --git a/.github/workflows/drive.yml b/.github/workflows/drive.yml index c8a23b83..933fb9a9 100644 --- a/.github/workflows/drive.yml +++ b/.github/workflows/drive.yml @@ -21,6 +21,7 @@ jobs: echo "AGENT_VERSION=${AGENT_VERSION}" echo "COMPOSE_FILE=${COMPOSE_FILE}" - name: 'Download artifact (PR ID)' + if: github.event_name == 'pull_request' uses: actions/github-script@v6 with: script: | @@ -46,10 +47,12 @@ jobs: fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_id.zip`, Buffer.from(download.data)); - name: 'Unzip artifact (PR ID)' + if: github.event_name == 'pull_request' run: | unzip pr_id.zip - name: Check PR ID + if: github.event_name == 'pull_request' uses: actions/github-script@v6 with: script: | @@ -71,6 +74,7 @@ jobs: run: docker compose down -v # add rendered JSON as comment to the pull request - name: Add simulation results as comment + if: github.event_name == 'pull_request' uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }}