Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

"unknown revision or path not in the working tree" should fail #164

Closed
peterbe opened this issue Jul 14, 2021 · 1 comment · Fixed by #161
Closed

"unknown revision or path not in the working tree" should fail #164

peterbe opened this issue Jul 14, 2021 · 1 comment · Fixed by #161
Assignees

Comments

@peterbe
Copy link
Contributor

peterbe commented Jul 14, 2021

Describe the bug: バグの概要

I'm not sure what the bug is. Basically, it should have crashed if it couldn't figure out what the difference was.
See this PR: https://github.com/mdn/content/pull/6734/files

The CI depends on get-diff-action to get a list of the files that would be tested in CI.
Once that's figured out, it runs a Node build for those specific files and if anything is wrong, it should break the build.
The problem is that get-diff-action didn't spot any changed files, so that part of CI never ran.

Here's the CI run: https://github.com/mdn/content/actions/runs/1015759281

Screenshot with the get-diff-action portion expanded.
Screen Shot 2021-07-14 at 9 43 16 AM

I still don't know why it didn't work on that PR but worked and continues to work on all other PRs. Perhaps the owner of the PR did something strange like a rebase forced push while the CI was running.

Either way, bug is if it can't even successfully run the git diff ... command, it should crash and fail. Instead, we got a GIT_DIFF that's empty.
Our CI depends on...:

      - uses: technote-space/[email protected]
        id: git_diff_content
        with:
          PATTERNS: files/**/*.+(html|md)
          SET_ENV_NAME: GIT_DIFF_CONTENT

      - name: Build changed content
        if: ${{ env.GIT_DIFF_CONTENT }}

Perhaps somewhere, get-diff-action, which is written in TypeScript, uses github-action-helper to call out to native git as a sub-command and perhaps it failed to bubble up that a command didn't exit 0.

To Reproduce: 再現手順

No idea. Sorry.

Expected behavior: 期待する動作

If it can't git diff ... because there's something wrong with the branch or the remote or something, it should fail.

@technote-space
Copy link
Owner

Changed the default behavior so that workflow will error when an error occurs in git diff.

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

Successfully merging a pull request may close this issue.

2 participants