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

New git CVE changes break this GHA #5

Open
KevinJCross opened this issue Apr 29, 2022 · 4 comments
Open

New git CVE changes break this GHA #5

KevinJCross opened this issue Apr 29, 2022 · 4 comments

Comments

@KevinJCross
Copy link

when using this GHA v1.0.12 we now get

Run UnicornGlobal/has-changes-action@v1.0.12
/usr/bin/docker run --name b31304f6ab38839452bb44ab0a5eb12df5c_0e9478 --label 294b31 --workdir /github/workspace --rm -e GOROOT -e INPUT_STATUS-ARGS -e INPUT_PATHSPEC -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/app-autoscaler-release/app-autoscaler-release":"/github/workspace" 294b31:304f6ab38839452bb44ab0a5eb12df5c  "" ""
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

This is the same problem that checkout recently had

@somidad
Copy link

somidad commented May 10, 2022

Same for me.

@somidad
Copy link

somidad commented May 13, 2022

@KevinJCross, I am now using below:

https://gist.github.com/somidad/3ce6e8a7b7d77ac8fa7fad583003d6f5

@KevinJCross
Copy link
Author

@gsongsong
Thanks its actually simpler than using this GHA 😆 .

escaped added a commit to woltapp/wolt-python-package-cookiecutter that referenced this issue May 25, 2022
silvestre added a commit to cloudfoundry/app-autoscaler-release that referenced this issue Aug 4, 2022
silvestre added a commit to cloudfoundry/app-autoscaler-release that referenced this issue Aug 5, 2022
stephenwan-opal added a commit to opalsecurity/terraform-provider-opal that referenced this issue Sep 21, 2022
stephenwan-opal added a commit to opalsecurity/terraform-provider-opal that referenced this issue Sep 21, 2022
UnicornGlobal/has-changes-action#5

There is a bug in ghe generator where the presence of the env var
will cause a diff during generation. We hack around this by blanking out the env var
during generation.

hashicorp/terraform-plugin-docs#12
LeslieColor added a commit to color/lokalise-actions that referenced this issue Nov 14, 2022
@astone123
Copy link

@KevinJCross, I am now using below:

https://gist.github.com/gsongsong/3ce6e8a7b7d77ac8fa7fad583003d6f5

- name: Check if there is any change
  id: get_changes
  run: echo "::set-output name=changed::$(git status --porcelain | wc -l)"
- name: Do something if there is any change
  if: steps.get_changes.outputs.changed != 0
  run: do something

This should now be

 - name: Check if there is any change
   id: get_changes
   run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
 - name: Do something if there is any change
   if: steps.get_changes.outputs.changed != 0
   run: do something

since Github is deprecating set-output in favor of Environment Files

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

3 participants