first try
This commit is contained in:
61
README.md
61
README.md
@ -1,62 +1,27 @@
|
|||||||
# Setup SOPS in GitHub Actions
|
# Setup SOPS and AGE in Gitea Actions
|
||||||
|
|
||||||
[](https://github.com/marketplace/actions/setup-sops)
|
This is forked and merged from
|
||||||
[](https://github.com/nhedger/setup-sops/actions/workflows/test.yaml)
|
|
||||||
[](https://github.com/nhedger/setup-sops/actions/workflows/integrate.yaml)
|
|
||||||
|
|
||||||
**Setup SOPS** is a GitHub action that provides a cross-platform interface
|
[nhedger/setup-sops](https://github.com/nhedger/setup-sops)
|
||||||
for setting up [SOPS](https://github.com/getsops/sops) in GitHub
|
[alessiodionisi/setup-age-action](https://github.com/alessiodionisi/setup-age-action)
|
||||||
Actions runners.
|
|
||||||
|
|
||||||
## Inputs
|
|
||||||
|
|
||||||
The following inputs are supported.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup SOPS
|
- name: Setup SOPS and AGE
|
||||||
uses: nhedger/setup-sops@v2
|
uses: actions/setup-sops-age@v1
|
||||||
with:
|
with:
|
||||||
|
|
||||||
# The version of SOPS to install.
|
# The version of SOPS to install.
|
||||||
# This input is optional and defaults to "latest".
|
# This input is optional and defaults to "latest".
|
||||||
# Example values: "3.7.3", "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.
|
# The GitHub token to use to authenticate GitHub API requests.
|
||||||
# This input is optional and defaults to the job's GitHub token.
|
# This input is optional and defaults to the job's GitHub token.
|
||||||
# Example value: ${{ secrets.GITHUB_TOKEN }}
|
# Example value: ${{ secrets.GITHUB_TOKEN }}
|
||||||
token: ${{ github.token }}
|
token: "<your githut 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).
|
|
||||||
|
|||||||
13
action.yaml
13
action.yaml
@ -3,3 +3,16 @@ description: 'Installs SOPS and AGE binaries'
|
|||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
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 }}
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
import { getInput as coreGetInput } from "@actions/core";
|
|
||||||
|
|
||||||
export const getInput = (name: string): string | undefined => {
|
|
||||||
return coreGetInput(name) === "" ? undefined : coreGetInput(name);
|
|
||||||
};
|
|
||||||
@ -9,13 +9,13 @@ import { age } from "./age";
|
|||||||
auth: (await createActionAuth()()).token,
|
auth: (await createActionAuth()()).token,
|
||||||
});
|
});
|
||||||
await sops({
|
await sops({
|
||||||
version: getInput("version"),
|
version: getInput("sopsVersion"),
|
||||||
platform: process.platform as "linux" | "darwin" | "win32",
|
platform: process.platform as "linux" | "darwin" | "win32",
|
||||||
arch: process.arch as "x64" | "arm64",
|
arch: process.arch as "x64" | "arm64",
|
||||||
octokit: octokit,
|
octokit: octokit,
|
||||||
});
|
});
|
||||||
await age({
|
await age({
|
||||||
version: getInput("version"),
|
version: getInput("ageVersion"),
|
||||||
platform: process.platform as "linux" | "darwin" | "win32",
|
platform: process.platform as "linux" | "darwin" | "win32",
|
||||||
arch: process.arch as "x64" | "arm64",
|
arch: process.arch as "x64" | "arm64",
|
||||||
octokit: octokit,
|
octokit: octokit,
|
||||||
|
|||||||
Reference in New Issue
Block a user