dmnemec / copy_file_to_another_repo_action

This GitHub Action copies a file from the current repository to a location in another repository
Apache License 2.0
182 stars 201 forks source link

When using multiple files in a matrix, the first copy will work... The next one will not because the source changed #67

Open JoseRodrigues443 opened 2 years ago

JoseRodrigues443 commented 2 years ago

The use case can be seen here:

https://github.com/JoseRodrigues443/Awesome-CV/blob/master/.github/workflows/main.yml

The build error:


Pushing git commit
+ git push -u origin HEAD:main
To https://github.com/JoseRodrigues443/joserodrigues443.github.io.git
 ! [rejected]        HEAD -> main (fetch first)
error: failed to push some refs to 'https://github.com/JoseRodrigues443/joserodrigues443.github.io.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing

The cause

Basically on a matrix, I selected 3 files to run the dmnemec/copy_file_to_another_repo_action action.

One is pushed, success, the second is pushed, fails because the origin changed... The action could make a git pull to make sure the push will succeed.

If the merge fails, ok let it fail.

JoseRodrigues443 commented 2 years ago

Currently I will be out of office. But after I came back in 2 weeks, I will try to make a fix for this issue.

Thank you