Added many, many more actions.
This commit is contained in:
25
utils/envsubst/.github/workflows/test.yaml
vendored
Normal file
25
utils/envsubst/.github/workflows/test.yaml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
#This is an example of a possible way to Unit Test a single action.
|
||||
name: "Run unit tests."
|
||||
on: workflow_call
|
||||
jobs:
|
||||
run-tests:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Run Test"
|
||||
id: test
|
||||
uses: ./.
|
||||
env:
|
||||
TEST_VAR: Hello, world!
|
||||
with:
|
||||
input: |
|
||||
And I say:
|
||||
"$TEST_VAR"
|
||||
- name: "Verify output."
|
||||
uses: act/common/utils/compare@master
|
||||
with:
|
||||
expected: |
|
||||
And I say:
|
||||
"Hello, world!"
|
||||
actual: |
|
||||
${{ steps.test.outputs.result }}
|
||||
31
utils/envsubst/action.yaml
Normal file
31
utils/envsubst/action.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
name: envsubst
|
||||
description: "Substitute environment variables in the given input."
|
||||
inputs:
|
||||
input:
|
||||
description: "Input to substitute."
|
||||
required: false
|
||||
tmpDir:
|
||||
description: "Temporary directory. Default: _tmp"
|
||||
required: true
|
||||
default: _tmp
|
||||
outputs:
|
||||
result:
|
||||
description: "The result of the substitution."
|
||||
value: ${{ steps.envsubst.outputs.console }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Make temporary file of input."
|
||||
id: mktmp
|
||||
uses: act/common/utils/mktemp@master
|
||||
with:
|
||||
input: ${{ inputs.input }}
|
||||
tmpDir: ${{ inputs.tmpDir }}
|
||||
- name: "Download file."
|
||||
id: envsubst
|
||||
uses: act/common/distros/rockylinux@master
|
||||
with:
|
||||
args: envsubst < ${{ steps.mktmp.outputs.tmp }}
|
||||
- name: "Remove temporary files."
|
||||
run: rm -rf "${{ inputs.tmpDir }}"
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user