-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Question: pull from main - push to otherbranch? #63
Comments
Hi, thanks for reaching out! Could you send me a link to your workflow run so that I can look at the logs? |
It's a private repo, I'll attach the raw log here: |
It seems that these logs don't match the workflow you posted, are you sure they're the right ones? I see different step names and that it's downloading the action from your fork |
Ciao Frederico, I poked around and the only option that seems to work is to rely on a shell script and native git calls. As an added complication the target directory needs to be added as git module. Since the main repo is never pushed back, that's fine. This is the script I finally used: #!/bin/bash
# Send UI back to a new branch in backend
now=$(date +"%Y-%m-%d_%H-%M")
message="[UI Commit] ${now}"
# Step1 clone backend
git submodule add https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/$REPO2 backend
# Step3 update UI
rm -rf backend/static/ui
mkdir -p backend/static/ui
cp build/* backend/static/ui/
cd backend
git config user.email "automation@acme.com"
git config user.name "Acme automation"
git add --all
git commit -m "$message"
git checkout -b ui/ui-$now
git push -u origin ui/ui-$now Nice lesson learned: I originally used Anyway - we can close that issue. And mille grazie for your willingness to help out. Very much appreciated |
Happy to hear that you managed to find a solution! This kind of issues can be hard to resolve since you're dealing with something that happens in a machine to which you don't have access, and I must confess that there's still some stuff I'm not really sure about GitHub Action runners 😅 |
Use case:
I have a
front-end
(Angular/React) and abackend
repository. When the CI is building the front-end, the result of the build folder needs to be committed to the/static
directory of the backend repo. With your contribution I came close - love it.The last hurdle is the error:
** Error: warning: Pulling without specifying how to reconcile divergent branches is discouraged **
which AFAIK stems from the fact that I checkout
master
from backend and try to push to (the non-existing) branchui-contribution
. Is there a way I can push to a new (or eventually existing) branch.-u --force
might do the trick, but where to put in in the YAML. My stuff so far:Love your work!
The text was updated successfully, but these errors were encountered: