Git Product home page Git Product logo

Comments (5)

EndBug avatar EndBug commented on May 26, 2024

Hi, thanks for reaching out! Could you send me a link to your workflow run so that I can look at the logs?

from add-and-commit.

Stwissel avatar Stwissel commented on May 26, 2024

It's a private repo, I'll attach the raw log here:
rawlog.txt

from add-and-commit.

EndBug avatar EndBug commented on May 26, 2024

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

from add-and-commit.

Stwissel avatar Stwissel commented on May 26, 2024

Ciao Frederico,
me dispiace, my team has cleaned out the log, that was the last one I could grab. I forked it, since I though I could change a little but that didn't work out. I isolated the issue and it seems a fundamental behaviour of git when you have subdirectories containing their own .git files.
Something the API might not allow us to address. Long story short: even if your working directory contains its own .git directory, the github actions API seems to treat any call against it as call towards the repository where the action was triggered from. So your code isn't the issue here.

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 "[email protected]"
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 $GITHUB_REPO as environment variable instead of $REPO2, but that one is hard wired to the current repo - took me an hour (or longer) to figure that.

Anyway - we can close that issue. And mille grazie for your willingness to help out. Very much appreciated

from add-and-commit.

EndBug avatar EndBug commented on May 26, 2024

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 😅
Feel free to open other issues if you have any problem
Ciao ;)

from add-and-commit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.