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

[Bug]: Actions fails while restoring .templatesyncignore if not already present #375

Closed
1 task done
aairey opened this issue Sep 2, 2023 · 5 comments · Fixed by #378
Closed
1 task done

[Bug]: Actions fails while restoring .templatesyncignore if not already present #375

aairey opened this issue Sep 2, 2023 · 5 comments · Fixed by #378
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aairey
Copy link

aairey commented Sep 2, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When there is no .templatesyncignore file present in the child repository yet, but one was added in the template - the template-sync action fails with:

Expected Behavior

Store the .templatesyncignore file from upstream. Ignore errors while restoring the file as it could not be present.

Current Behavior

The action fails with:

restore ignore file
  ::info::restore the ignore file
  ++ git checkout -- .templatesyncignore
  error: pathspec '.templatesyncignore' did not match any file(s) known to git

Steps To Reproduce

  1. Create template repo with just a README.md and add template-sync workflow
  2. Create a repo from this template
  3. Add .templatesyncignore in the template
  4. Sync child repo with template

Possible Solution

Ignore errors during file restore.

Additional Information/Context

Was introduced with #250 and #251 .

Template sync version Version

1.1.1

@aairey aairey added the bug Something isn't working label Sep 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2023

Hi! Thank you for your contribution!'Happy coding! 🚀

@aairey aairey changed the title [Bug]: <insert bug description> [Bug]: Actions fails while restoring .templatesyncignore if not already present Sep 2, 2023
@AndreasAugustin
Copy link
Owner

Hi @aairey and thank you very much for the 🐛 issue and the nice description with example.
Was able to reproduce the issue with a local test and reading the code logic it is obvious that e.g. git reset -- .templatesyncignore is not working if the file is not present in the history but with your case you hit the if condition.

Will provide a fix ASAP (maybe the next days).

@AndreasAugustin AndreasAugustin self-assigned this Sep 2, 2023
@AndreasAugustin AndreasAugustin added this to the v1.0.0 milestone Sep 2, 2023
@AndreasAugustin
Copy link
Owner

@all-contributors please add @aairey for bug

@allcontributors
Copy link
Contributor

@AndreasAugustin

I've put up a pull request to add @aairey! 🎉

AndreasAugustin added a commit that referenced this issue Sep 2, 2023
when there is an .templatesyncignore file present within source
repository but not in target repo, the program stopped
@AndreasAugustin
Copy link
Owner

@aairey #378 should fix the issue. Will build a new version soon.

AndreasAugustin added a commit that referenced this issue Sep 3, 2023
when there is an .templatesyncignore file present within source
repository but not in target repo, the program stopped
AndreasAugustin added a commit that referenced this issue Sep 3, 2023
* chore(main): release 1.1.2

* docs: 🚀 (#375) version bump for new release

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andy Augustin <dev@andreas-augustin.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants