Skip to content

LeastAuthority/mount-tmpfs-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mount-tmpfs

GitHub action to create and mount a temporary file system in memory.

It can be used as an attempt to keep secrets from being written to disk.

Usage

⚠️ Please consider the physical limitations of the GitHub runners before changing the values.

    - name: Get a tmpfs for our secret
      id: tmpfs
      uses: LeastAuthority/mount-tmpfs-action@v1
      with:
        size: 2
        root: '/mnt'

The action then returns the uuid and the mount point of the tmpfs as outputs.

    - name: Import secret in tmpfs
      run: |
        cat <<EOF > "${{ steps.tmpfs.outputs.mnt }}/secret_key"
        ${{ secrets.KEY }}
        EOF

Optionally, the tmpfs could be removed when no longer needed.

    - name: Cleanup
      run: |
        sudo umount "${{ steps.tmpfs.outputs.mnt }}"

About

Create and mount a temporary disk in memory

Resources

License

Stars

Watchers

Forks

Packages

No packages published