Github actions debug workflow

Hi people,

I created workflow that should do something on pull request comment.
After I fixed all yaml syntax and formatting I stuck. As for now, each time I comment on PR I don’t see anything in the github actions pane.

This is my workflow:

on:
  issue_comment:
    types: [ created ]

jobs:
  benchmark:
    if: |
      ${{ github.event.issue.pull_request }}
      startsWith(github.event.comment.body, '/run-benchmark')

    runs-on: ubuntu-latest

    steps:
      - name: Clone Repo
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Setup SDK
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt-hotspot'
          java-version: '15'

      - name: Install and run Gradle Profiler over SDKMAN
        run: |
          curl -s "https://get.sdkman.io" | bash
          source "$HOME/.sdkman/bin/sdkman-init.sh"
          sdk install gradleprofiler
          gradle-profiler --benchmark --project-dir . --scenario-file ./gradle/profiler/main.scenarios

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: csv-benchmark-head
          path: profile-out*/benchmark.csv

Appreciate any tips for debugging or if you spot some error.

The if value doesn’t look quite right. Can you try the following?

    if: >-
      github.event.issue.pull_request &&
      startsWith(github.event.comment.body, '/run-benchmark')
1 Like

Thanks a lot for suggestion but it was not the case. It doesn’t run still.

Finally, I got help from GitHub and the issue that this workflow is not yet in the default branch. That is strange since I remember and successful and failed runs before.

1 Like