From 91760ddbe17444cae25577a0fd6b65ceab49be79 Mon Sep 17 00:00:00 2001 From: Soule BA Date: Wed, 19 Jan 2022 16:12:08 +0100 Subject: [PATCH] Add a github action for sops If implemented, this code will enable flux packages to use this action to run sops commands. Signed-off-by: Soule BA --- .github/workflows/actions.yaml | 1 + actions/sops/action.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 actions/sops/action.yaml diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index ec0bd4d52..fc699a260 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -30,6 +30,7 @@ jobs: - uses: ./actions/kustomize - uses: ./actions/helm - uses: ./actions/kubebuilder + - uses: ./actions/sops - uses: ./actions/sbom with: image: ghcr.io/fluxcd/kustomize-controller:v0.19.1 diff --git a/actions/sops/action.yaml b/actions/sops/action.yaml new file mode 100644 index 000000000..764a18c4c --- /dev/null +++ b/actions/sops/action.yaml @@ -0,0 +1,25 @@ +name: Setup SOPS +description: A GitHub Action for running sops commands +author: Soule BA +branding: + color: blue + icon: command +inputs: + version: + description: "strict semver" + required: true + default: "3.7.1" +runs: + using: composite + steps: + - name: "Download and copy the binary to /usr/local/bin" + shell: bash + run: | + VERSION=${{ inputs.version }} + REPO_URL=https://github.com/mozilla/sops/releases/download + BIN_URL="${REPO_URL}/v${VERSION}/sops-v${VERSION}.linux" + curl -fL --no-progress-meter ${BIN_URL} -o /tmp/sops + chmod +x /tmp/sops + sudo mv /tmp/kustomize/kustomize /usr/local/bin + which sops + sops --version \ No newline at end of file