From 34fb0e764d408c4f38b6ed11ec8abd184ffd7ddb Mon Sep 17 00:00:00 2001 From: Stephan Linkel Date: Sun, 6 Jul 2025 12:02:16 +0200 Subject: [PATCH] first try --- README.md | 61 +++++++++++--------------------------------------- action.yaml | 13 +++++++++++ src/helpers.ts | 5 ----- src/index.ts | 4 ++-- 4 files changed, 28 insertions(+), 55 deletions(-) delete mode 100644 src/helpers.ts diff --git a/README.md b/README.md index 2762996..983fc9a 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,27 @@ -# Setup SOPS in GitHub Actions +# Setup SOPS and AGE in Gitea Actions -[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nhedger/setup-sops?label=latest&logo=github)](https://github.com/marketplace/actions/setup-sops) -[![Test](https://github.com/nhedger/setup-sops/actions/workflows/test.yaml/badge.svg)](https://github.com/nhedger/setup-sops/actions/workflows/test.yaml) -[![Integrate](https://github.com/nhedger/setup-sops/actions/workflows/integrate.yaml/badge.svg)](https://github.com/nhedger/setup-sops/actions/workflows/integrate.yaml) +This is forked and merged from -**Setup SOPS** is a GitHub action that provides a cross-platform interface -for setting up [SOPS](https://github.com/getsops/sops) in GitHub -Actions runners. - -## Inputs - -The following inputs are supported. +[nhedger/setup-sops](https://github.com/nhedger/setup-sops) +[alessiodionisi/setup-age-action](https://github.com/alessiodionisi/setup-age-action) ```yaml -- name: Setup SOPS - uses: nhedger/setup-sops@v2 +- name: Setup SOPS and AGE + uses: actions/setup-sops-age@v1 with: # The version of SOPS to install. # This input is optional and defaults to "latest". # Example values: "3.7.3", "latest" - version: "latest" + sopsVersion: "latest" + + # The version of AGE to install. + # This input is optional and defaults to "latest". + # Example values: "3.7.3", "latest" + ageVersion: "latest" # The GitHub token to use to authenticate GitHub API requests. # This input is optional and defaults to the job's GitHub token. # Example value: ${{ secrets.GITHUB_TOKEN }} - token: ${{ github.token }} + token: "" ``` - -## Examples - -### Basic example - -Setup the latest version of SOPS. - -```yaml -- name: Setup SOPS - uses: nhedger/setup-sops@v2 - -- name: Run SOPS - run: sops --version -``` - -### Specific version - -Install version `3.7.3` of SOPS. - -```yaml -- name: Setup SOPS - uses: nhedger/setup-sops@v2 - with: - version: 3.7.3 - -- name: Run SOPS - run: sops --version -``` - -## License - -The scripts and documentation in this project are licensed under -the [MIT License](LICENSE.md). diff --git a/action.yaml b/action.yaml index f5ebce1..08029e0 100644 --- a/action.yaml +++ b/action.yaml @@ -3,3 +3,16 @@ description: 'Installs SOPS and AGE binaries' runs: using: 'node20' main: 'dist/index.js' +inputs: + sopsVersion: + description: The version of SOPS to install + required: true + default: latest + ageVersion: + description: The version of AGE to install + required: true + default: latest + token: + description: GitHub Actions token to authenticate API requests + required: true + default: ${{ github.token }} diff --git a/src/helpers.ts b/src/helpers.ts deleted file mode 100644 index 4334b28..0000000 --- a/src/helpers.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getInput as coreGetInput } from "@actions/core"; - -export const getInput = (name: string): string | undefined => { - return coreGetInput(name) === "" ? undefined : coreGetInput(name); -}; diff --git a/src/index.ts b/src/index.ts index 7864e3b..233a58c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,13 +9,13 @@ import { age } from "./age"; auth: (await createActionAuth()()).token, }); await sops({ - version: getInput("version"), + version: getInput("sopsVersion"), platform: process.platform as "linux" | "darwin" | "win32", arch: process.arch as "x64" | "arm64", octokit: octokit, }); await age({ - version: getInput("version"), + version: getInput("ageVersion"), platform: process.platform as "linux" | "darwin" | "win32", arch: process.arch as "x64" | "arm64", octokit: octokit,