Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow fails with "nothing added to commit but untracked files present" #40

Open
telatin opened this issue Sep 16, 2022 · 3 comments
Open

Comments

@telatin
Copy link

telatin commented Sep 16, 2022

Howdy,
It passed a while since I updated the screenshots so maybe I'm missing something obvious, but the workflow fails under the "Pushing any changes found" subtree:

INFO     Saved: 'docs/img/screenshot-rc.svg' (17.37% change)                    
INFO     Saved: 'docs/img/screenshot-rc.svg' (17.37% change)                    
INFO     Saving list of new file paths to: created.txt                          
INFO     Skipped 27 images 🤫                                                   
INFO     Saved 2 images ✨                                                      
Run echo "::group::Pushing any changes found"
Pushing any changes found
  🕵️‍♀️ Git status after run:
  ?? created.txt
  💥 Found some changes from running rich-codex!
  On branch main
  Your branch is up to date with 'origin/main'.
  
  Untracked files:
    (use "git add <file>..." to include in what will be committed)
  	created.txt
  
  nothing added to commit but untracked files present (use "git add" to track)
  Error: Process completed with exit code 1.

Sometimes just re-running the pipeline makes it work, do you have any suggestions on when to run the workflow or what to check?

@ewels
Copy link
Owner

ewels commented Sep 16, 2022

Odd. Would you mind linking to the full CI run please? It would be useful to see the full command that's collapsed under Run echo "::group::Pushing any changes found"

@telatin
Copy link
Author

telatin commented Sep 17, 2022

Link: https://github.com/telatin/seqfu2/actions/runs/3068736296

Run echo "::group::Pushing any changes found"
  echo "::group::Pushing any changes found"
  git config --local user.name 'github-actions[bot]'
  git config --local user.email 'github-actions[bot]@users.noreply.github.com'
  echo "🕵️‍♀️ Git status after run:"
  git status -s
  if [[ -f created.txt || -f deleted.txt ]]; then
    echo "💥 Found some changes from running rich-codex!"
    if [[ true ]]; then
      [[ -f created.txt ]] && git add $(cat created.txt)
      [[ -f deleted.txt ]] && git rm $(cat deleted.txt)
      git commit -m "Generate new screengrabs with rich-codex"
      git push
      echo "🤖 Pushed commit with new changes!"
    elif [[ true ]]; then
      echo "🤖 Tip: Use 'commit_changes' to automatically commit them next time."
      (exit 1)
    fi
  else
    echo "🤫 No changes from rich-codex found!"
  fi
  echo "::endgroup::"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    PATH: /home/runner/.nimble/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    pythonLocation: /opt/hostedtoolcache/Python/3.10.6/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.6/x64/lib

@ewels
Copy link
Owner

ewels commented Sep 17, 2022

This is very strange 🤔 I don't really understand what's going wrong.

Rich-codex is saying that it's saved two new files and it tries to do git add with them, but git seems to think that they haven't changed, I guess? I don't understand why they're not showing with the git status call (which is there for exactly this kind of debugging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants