0

I host my git-repo on GitHub.com. Several developers contribute code to either the develop- or feature branch respectively. Once all the tests have passed, the changes are merged into master.

Now, once such a pull-request/merge has been done, the master brach shall be pushed automatically to another GitHub-Repo (where another team picks it up). This is when "Workflows" come into play. So I created this yaml file to trigger a "git push" after a successfull pull-requrest:

name: push master to official repository
on:
  pull_request:
    types: [closed]
jobs:
  gitHubPush:
    runs-on: ubuntu-latest
    steps:
     - run: "git push https://github.com/OFFICIAL/MyProject master"

But this doesn't work. I get:

fatal: not a git repository (or any of the parent directories): .git Error: Process completed with exit code 128.

The GitHub Account is registered as "Contributor" on OFFICIAL.

Can you help me out ?

1 Answer 1

1

You have to checkout your repository first:

- name: Checkout
  uses: actions/checkout@v2

More information about checkout options to find the best fitting your needs here: https://github.com/actions/checkout/

Sign up to request clarification or add additional context in comments.

1 Comment

Unfortunately no. I still get: remote: Repository not found. But when you click on the Link it opens without problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.