-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.05 KB
/
gen-ci-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Reuseable CI action
on:
workflow_call:
inputs:
env_name:
default: default
required: false
type: string
ref:
required: false
type: string
jobs:
build:
name: "Run CI test"
runs-on: ubuntu-latest
environment: ${{ inputs.env_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
if: ${{ inputs.ref == '' }}
- name: Checkout/ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
if: ${{ inputs.ref != '' }}
- name: Test environent:
run:
echo "ENV name: ${{ inputs.env_name }}"
- name: Test README
run: cat README.md
- name: Test secret
run: |
echo "Test secret => ${TEST_SECRET}"
echo $TEST_SECRET | rev
if [[ "x${{ secrets.ENV_SECRET }}" == "x442" ]]; then
echo "secret is good"
else
echo "no secrets"
exit 1
fi
env:
TEST_SECRET: ${{ secrets.ENV_SECRET }}