stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
1.92k stars 224 forks source link

GITHUB_OUTPUT: unbound variable #254

Closed SlinToWin closed 1 year ago

SlinToWin commented 1 year ago

git-auto-commit Version

v4.15.2

Machine Type

Ubuntu (eg. ubuntu-latest)

Bug description

Hello, we have a regression bug with the latest patch version v4.15.2 The outcome is an error on the autocommit step preventing the commit.

We use the autocommit action in an enterprise GH installation.

We pinned currently the version to v4.15.1 but would like to use v4 tag again.

Steps to reproduce

Just using the 4.15.2 in a GH Enterprise environment

Tried solutions

No response

Example Workflow

---
name: Scale up DEV cluster

on:
  workflow_dispatch:
  schedule:
    - cron: 15 6 * * 1-5
jobs:
  build:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v3
        with:
          token: ${{ secrets.SecretToken }}
      - name: Scale up environments
        run: |
          set -e
          sh bin/cluster-scale-up.sh
      - name: Commit scale up
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "deploy: cluster scale up"

Relevant log output

Started: bash /runner/_work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS: 
INPUT_FILE_PATTERN: .
/runner/_work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh: line 14: GITHUB_OUTPUT: unbound variable
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/runner/_work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/runner/_work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
stefanzweifel commented 1 year ago

Thanks for reporting! I almost expected this to happen for users of GitHub Enterprise. :/

GitHub introduced some changes on how output variables have to be declared. This has been changed in #252 and v4.15.2.

As a GitHub Enterprise user, your Actions runner needs to be updated. I added a comment in the release discussion about this: https://github.com/stefanzweifel/git-auto-commit-action/discussions/253#discussioncomment-3939231

To make things easier, I will temporarily point v4 back to v4.15.1 and re-add the old syntax. The deprecated syntax to set output variables will not be removed until June 2023.

stefanzweifel commented 1 year ago

v4 now points to v4.15.1 (https://github.com/stefanzweifel/git-auto-commit-action/commit/fd157da78fa13d9383e5580d1fd1184d89554b51) again.

SlinToWin commented 1 year ago

Hi @stefanzweifel Great to here that, i will open an Issue on our Infrastructure provider to update the runners. Thanks for the detailed explanation :) I will close the issue as this is not a bug.

Best Konrad