Skip to content

MobileDevOps/secret-to-file-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secret to File GitHub Action

GitHub doesn't allow storing files as secrets. But files like certificates or 3rd party license files are often needed during the build process. And instead of saving it publically in the repository, it should be stored as a secret. This action allows storing the content of a file as a base64 secret and writing it to a file during the build process.

The content of the file has to be base64 encoded.

Encoding a file

macOS:

base64 -i <file> -o <file>.base64

Linux:

base64 <file> > <file>.base64

Usage

Create a secret, e.g. like FILE_CONTENT in the screenshot, and add the base64 content of the file as value.

Create secret

And use the action in your workflow:

on: [push]

jobs:
  main:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Flutter SDK
        uses: mobiledevops/secret-to-file-action@v1
        with:
          base64-encoded-secret: ${{ secrets.FILE_CONTENT }}
          filename: "hello-world.sh"
          is-executable: true
          working-directory: "./a/b/c"
      - run: ./a/b/c/hello-world.sh

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published