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

No way to commit once unlocked #14

Open
alexnault opened this issue Apr 16, 2021 · 2 comments
Open

No way to commit once unlocked #14

alexnault opened this issue Apr 16, 2021 · 2 comments

Comments

@alexnault
Copy link

Once the repo is unlocked, any attempt to commit from the GH Action will result in an error:

"git-crypt" clean: 1: git-crypt: not found
error: external filter '"git-crypt" clean' failed 127
error: external filter '"git-crypt" clean' failed
@alexnault
Copy link
Author

My current workaround is to manually install git-crypt and set the $GITHUB_PATH:

name: Deploy

on:
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      # ...
      
      - name: Install git-crypt
        run: |
          git clone https://github.com/AGWA/git-crypt.git
          cd git-crypt && make && make install PREFIX=/opt/project
          echo "/opt/project/bin" >> $GITHUB_PATH

      - name: Unlock git-crypt
        run: |
          echo ${{ secrets.GIT_CRYPT_KEY }} | base64  -d > ./git-crypt-key
          git-crypt unlock ./git-crypt-key
          rm ./git-crypt-key

      - name: Login with built-in token to enable commiting
        run: |
          git config user.name github-actions
          git config user.email [email protected]

       # ...

@Francismb
Copy link

Same issue, I believe it is because the git-crypt folder inside .git ends up being owned by root, not the user the worker is running in.

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

2 participants