Github Composite action cannot find file

Viewed 531

I have created an action that runs the following command

 - name: Create Release Notes File
   env: 
    COMMITTEXT: "${{ github.event.head_commit.message }}"
   run: |
      php ./create-release-notes-file.php

The file is in the same folder as the create-release.yml which is .github/workflows

when the action runs it fails with the following error:

Run php ./create-release-notes-file.php
Could not open input file: ./create-release-notes-file.php
Error: Process completed with exit code 1.

I can't find any documentation that tells me to put the files anywhere else. Any suggestions welcomed

1 Answers

Be sure to have cloned the repo before the above step (like with the actions/checkout@v3), as example:

jobs:
  create-release-note:
    name: Create Release note
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3
      with:
        fetch-depth: 0
        persist-credentials: false
        token: ${{ secrets.GH_API_TOKEN }}
    - name: Create Release Notes File
      env: 
       COMMITTEXT: "${{ github.event.head_commit.message }}"
      run: |
       php ./create-release-notes-file.php
Related