Skip to content

commit_sha returns the full SHA instead of the 7-character SHA #501

Closed

Description

@DenverCoder1

Describe the bug

commit_sha and commit_long_sha seem to return the same value even though commit_sha is supposed to be the short version according to the docs.

This seems like it is relevant to this release - https://github.com/steveukx/git-js/releases/tag/simple-git%403.6.0

committed: true
commit_long_sha: b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e
commit_sha: b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e

Workflow used

name: Add and Commit Test
on:
  workflow_dispatch:

jobs:
  run:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v3
      - run: date > test.txt
      - uses: EndBug/add-and-commit@main
        id: add-and-commit
      - run: |
          echo "committed: ${{ steps.add-and-commit.outputs.pushed }}"
          echo "commit_long_sha: ${{ steps.add-and-commit.outputs.commit_long_sha }}"
          echo "commit_sha: ${{ steps.add-and-commit.outputs.commit_sha }}"
        shell: bash

Expected behavior

committed: true
commit_long_sha: b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e
commit_sha: b3e6c90

Logs
Either provide a link to the action run or (if your repo is private) paste here the logs from the step that uses it. If you paste the logs, please use this template, and remember to paste the logs from all the different sections.

Logs
Run EndBug/add-and-commit@main
  with:
    add: .
    cwd: .
    default_author: github_actor
    fetch: --tags --force
    pathspec_error_handling: ignore
    push: true
    github_token: ***
Running in /home/runner/work/action-test-repo/action-test-repo
Add input parsed as single string, running 1 git add command.
> Using 'DenverCoder1 ' as author.
> Using "Commit from GitHub Actions (Add and Commit Test)" as commit message.
Internal logs
  > Staging files...
  > Adding files...
  > No files to remove.
  > Checking for uncommitted changes in the git working tree...
  > Found 1 changed files.
  > Fetching repo...
  {
    raw: '',
    remote: 'https://github.com/DenverCoder1/action-test-repo',
    branches: [ { name: 'gh-pages', tracking: 'origin/gh-pages' } ],
    tags: []
  }
  > Not pulling from repo.
  > Creating commit...
  {
    author: null,
    branch: 'main',
    commit: 'b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e',
    root: false,
    summary: { changes: 1, insertions: 1, deletions: 1 }
  }
  > No tag info provided.
  > Pushing commit to repo...
  {
    pushed: [],
    update: {
      head: { local: 'refs/heads/main', remote: 'refs/heads/main' },
      hash: { from: 'ab1ab2f', to: 'b3e6c90' }
    },
    repo: 'https://github.com/DenverCoder1/action-test-repo',
    ref: { local: 'refs/remotes/origin/main' },
    remoteMessages: It { all: [] }
  }
  > No tags to push.
> Task completed.
Outputs
  committed: true
  commit_long_sha: b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e
  commit_sha: b3e6c9089a49153e1f3ffe4d93dfb8aad9fa961e
  pushed: true
  tagged: false
  tag_pushed: false

Activity

  1. added
    status: pending
    on Apr 25, 2023
  2. changed the title [-]`commit_sha` seems to return the full SHA instead of the 7-character SHA as the docs say[/-] [+]`commit_sha` returns the full SHA instead of the 7-character SHA as the docs say[/+] on Apr 25, 2023
  3. changed the title [-]`commit_sha` returns the full SHA instead of the 7-character SHA as the docs say[/-] [+]`commit_sha` returns the full SHA instead of the 7-character SHA[/+] on Apr 25, 2023
  4. added
    type: bug
    and removed
    status: pending
    on Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions