Skip to content

'No such file or directory' Error when running scheduled github action #27093

Answered by airtower-luna
mlampros asked this question in Actions
Discussion options

You must be logged in to vote

This part of the workflow is your problem:

    steps:
      - uses: actions/checkout@v2
        if: github.event_name == 'pull_request'
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.ref }}
      - uses: actions/checkout@v2
        if: github.event_name == 'push'
        with:
          fetch-depth: 0

The if conditions on the two actions/checkout effectively mean that checkout will only happen for push or pull_request events, not on the scheduled run. So your repository data isn’t available. One simple fix would be to change the second condition to github.event_name != 'pull_request'.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants