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

Directory doesn't seem to be working #60

Open
gwolbers opened this issue Jul 9, 2020 · 1 comment
Open

Directory doesn't seem to be working #60

gwolbers opened this issue Jul 9, 2020 · 1 comment

Comments

@gwolbers
Copy link

gwolbers commented Jul 9, 2020

I've got two repo's: test_workflow en test_workflow_dev. Repo test_workflow runs an ant-build and puts the result in directory output. I only want to push the content of directory output to repository test_workflow_dev. My yaml-file looks like this:

name: push output

on:
  push:
    paths:
    - 'input/**.docx'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        persist-credentials: false
        fetch-depth: 0
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build with Ant
      run: ant -noinput -buildfile build.xml -lib ./lib
    - name: Commit files
      run: |
        git config --local user.email [mail]
        git config --local user.name [user]
        git add ./output
        git commit -m "Update output"
    - name: Push changes
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ secrets.USER_TOKEN }}
        directory: './output'
        repository: '[user]/test_workflow_dev'

When I use 'force: true' the whole repo test_workflow is pushed, not only output, but I get no errors. When I omit 'force: true', I get errors:

Run ad-m/github-push-action@master
  with:
    github_token: ***
    directory: ./output
    repository: [user]/test_workflow_dev
    branch: master
  env:
    JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.252/x64
    JAVA_HOME_8.0.252_x64: /opt/hostedtoolcache/jdk/8.0.252/x64
Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
Push to branch master
To https://github.com/[user]/test_workflow_dev.git
 ! [rejected]        HEAD -> master (fetch first)
error: failed to push some refs to 'https://github.com/[user]/test_workflow_dev.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
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)

Is this a bug or am I doing something wrong? I hope it's the last.

Help appreciated.

@kramrm
Copy link

kramrm commented Sep 13, 2020

Looks related to #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants