EndBug / add-and-commit

:octocat: Automatically commit changes made in your workflow run directly to your repo
MIT License
1.15k stars 117 forks source link

Action not commiting #657

Closed CrypticVerse closed 3 months ago

CrypticVerse commented 3 months ago

Describe the bug When I use the action, gradle generates a file to meta/versions/my-file.json. Before this step, I checkout the other repo that I want to commit to and place it on the ./meta/ path. With this action, I try to add the my-file.json, but the actions says: No files to commit; working tree clean

Workflow used

      - name: Generate Installer JSON
        run: ./gradlew generateInstallerJson --stacktrace
        env:
          MC_VERSION: ${{ vars.LATEST_MC_VERSION }}

      - name: Commit artifacts to meta repo
        uses: EndBug/add-and-commit@v9
        with:
          add: "*.json"
          author_name: CrypticVerse
          cwd: "./meta/"
          message: "New MC Launcher Json"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expected behavior The file would commit.

Logs Either provide a link to the action run or (if your repo is private) paste here the logs from the step that uses it. If you paste the logs, please use this template, and remember to paste the logs from all the different sections.

Logs
Run EndBug/add-and-commit@v9
Running in /home/runner/work/notebook-loader/notebook-loader/meta/
Add input parsed as single string, running 1 git add command.
> Using 'CrypticVerse ' as author.
> Using "New MC Launcher Json" as commit message.
Internal logs
  > Staging files...
  > Adding files...
  > No files to remove.
  > Checking for uncommitted changes in the git working tree...
> Working tree clean. Nothing to commit.
Outputs
  committed: false
  commit_long_sha: undefined
  commit_sha: undefined
  pushed: false
  tagged: false
  tag_pushed: false
EndBug commented 3 months ago

Since you didn't post/link the full logs, the only things I can suggest are:

CrypticVerse commented 3 months ago

Turns out it was my .gitignore... I have it set up so everything is ignored except files I choose. Just forgot to add it in there.