super-linter: Failed to initialize GITHUB_BEFORE_SHA for a push event. Output: HEAD^2~-1
Is there an existing issue for this?
- I have searched the existing issues
Are you using the latest Super-linter version available?
-
I am using the latest Super-linter version.
-
I can reproduce the issue running Super-linter using complete version identifier (example: vX.Y.Z), and not just with a partial one (example: vX)
-
I am using the super-linter/super-linter action or container image, and not the deprecated github/super-linter action or container image.
Are you resonably sure that it’s a Super-linter issue, and not an issue related to a tool that Super-linter runs?
- I think that this is a Super-linter issue.
Current Behavior
super-linter should not fail unless there is a linter issue
Expected Behavior
super-linter is failing for a GITHUB_SHA issue
Super-Linter version
latest (7.1.0)
Super-linter configuration
- name: Super-Linter
uses: super-linter/super-linter@latest
env:
DEFAULT_BRANCH: develop
FILTER_REGEX_EXCLUDE: ./db/schema.rb
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: /
RUBY_CONFIG_FILE: '.rubocop.yml'
VALIDATE_ALL_CODEBASE: false
VALIDATE_DOCKERFILE_HADOLINT: false
YAML_CONFIG_FILE: '.yaml-lint.yml'
YAML_ERROR_ON_WARNING: false
VALIDATE_JAVASCRIPT_PRETTIER: false
VALIDATE_JSON_PRETTIER: false
VALIDATE_YAML_PRETTIER: false
Relevant log output
2024-09-26 18:07:11 [INFO] --------------------------------------------
2024-09-26 18:07:11 [INFO] Gathering GitHub information...
2024-09-26 18:07:11 [INFO] Successfully validated GITHUB_WORKSPACE: /github/workspace
2024-09-26 18:07:11 [INFO] Successfully found GITHUB_EVENT_PATH: /github/workflow/event.json]
2024-09-26 18:07:11 [INFO] Successfully found GITHUB_SHA: e8fd3808e35b28ac12c507c1951ff0618a86b29f
2024-09-26 18:07:11 [INFO] Successfully found GITHUB_PUSH_COMMIT_COUNT: 0
fatal: ambiguous argument 'HEAD^2~-1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
2024-09-26 18:07:11 [FATAL] Failed to initialize GITHUB_BEFORE_SHA for a push event. Output: HEAD^2~-1
Steps To Reproduce
Couldn’t identified a pattern where this happens.
Anything else?
It happens only in the master branch, in develop is working ok. Weird.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (3 by maintainers)
Commits related to this issue
- fix: handle push tag events on merge commits When a "push tag" event triggers a GitHub Actions workflow, the "commits" array in the event payload is empty, so the commit count in this case (GITHUB_PU... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: handle push tag events on merge commits When a "push tag" event triggers a GitHub Actions workflow, the "commits" array in the event payload is empty, so the commit count in this case (GITHUB_PU... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: handle push tag events on merge commits When a "push tag" event triggers a GitHub Actions workflow, the "commits" array in the event payload is empty, so the commit count in this case (GITHUB_PU... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: handle push tag events on merge commits When a "push tag" event triggers a GitHub Actions workflow, the "commits" array in the event payload is empty, so the commit count in this case (GITHUB_PU... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: handle push tag events on merge commits (#6204) When a "push tag" event triggers a GitHub Actions workflow, the "commits" array in the event payload is empty, so the commit count in this case (G... — committed to j3din00b/super-linter by ferrarimarco 2 years ago
This log is quite useful, actually because it seems about pushing a tag (
"ref": "refs/tags/v3.21.0"). I think #6204 will cover this case.I am not sure if #6204 has been released but I am facing the same issue with super linter 7.2.0 so it doesn’t look like the problem is resolved. My repo is public (https://github.com/leplusorg/docker-latex) and the commit 06bb274 is tag of a merge.
I’ll just ignore the failure but thought I’d let you know.
Relevant logs:
Thanks for providing the graph! I’ll check if the test case matches it.