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

using with git-crypt #2529

Closed
Borda opened this issue Nov 13, 2023 · 4 comments
Closed

using with git-crypt #2529

Borda opened this issue Nov 13, 2023 · 4 comments

Comments

@Borda
Copy link

Borda commented Nov 13, 2023

Subject of the issue

We have repo encrypted so at the beginning of the job we decrypt it with:

  - name: Unlock secrets
    uses: sliteteam/[email protected]
    env:
      GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT }}

but then the create PR still fails with:

Create or update the pull request branch
  /usr/bin/git symbolic-ref HEAD --short
  main
  Working base is branch 'main'
  /usr/bin/git checkout --progress -B b41f56e3-3011-4bcc-87b5-c2b4fc1518bf HEAD --
  git-crypt: Error: Unable to open key file - have you unlocked/initialized this repository yet?
  error: external filter '"git-crypt" clean' failed 1
  error: external filter '"git-crypt" clean' failed
  fatal: kubernetes/prod/values.yml: clean filter 'git-crypt' failed
  Error: The process '/usr/bin/git' failed with exit code 128
@Borda
Copy link
Author

Borda commented Nov 13, 2023

for some reason, replacing the sliteteam/[email protected]
with just running the code for un-crypt helped:

  - run: |
      sudo apt-get update -q
      sudo apt-get install -y git-crypt
      git config --global --add safe.directory $(pwd)
      echo ${{ secrets.GIT_CRYPT }} | base64 --decode | git-crypt unlock /dev/stdin

@peter-evans
Copy link
Owner

Hi @Borda

Good to see that you found a workaround.

Is it similar to this issue? sliteteam/github-action-git-crypt-unlock#12
It could just be a bug of that action.

@Borda
Copy link
Author

Borda commented Nov 13, 2023

Is it similar to this issue? sliteteam/github-action-git-crypt-unlock#12 It could just be a bug of that action.

Seems different as our solution stream the key and so tried with file and worked too...

@peter-evans
Copy link
Owner

I'll close this now because I don't think there is an issue with this action. Your workaround will be helpful to anyone searching for help. 👍

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
@Borda @peter-evans and others