Compare commits
3 commits
955406d39d
...
3853e5f0b9
Author | SHA1 | Date | |
---|---|---|---|
3853e5f0b9 | |||
30d564eb4f | |||
1e173bb853 |
3 changed files with 32 additions and 0 deletions
|
@ -14,3 +14,10 @@ jobs:
|
|||
- run: spcd-build-project
|
||||
- run: spcd-browse-workspace
|
||||
- run: spcd-synchronize
|
||||
- name: Fetch num squared
|
||||
id: get_square
|
||||
uses: ./ # Uses an action in the root directory
|
||||
# or use a released Github Action
|
||||
# uses: shipyard/github-action/fetch-shipyard-env@1.0.0
|
||||
with:
|
||||
num: 11
|
||||
|
|
14
action.yaml
Normal file
14
action.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
name: 'Custom Github Action'
|
||||
description: 'A Github Action that takes an input and returns the square of the number'
|
||||
inputs:
|
||||
num:
|
||||
description: 'Enter a number'
|
||||
required: true
|
||||
default: "1"
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Fetch the number's square
|
||||
id: get-square
|
||||
run: python3 -m get_num_square.py
|
||||
shell: bash
|
11
get_num_square.py
Normal file
11
get_num_square.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import os
|
||||
|
||||
num = os.environ.get("INPUT_NUM")
|
||||
if num:
|
||||
try:
|
||||
num = int(num)
|
||||
except Exception:
|
||||
exit("ERROR: the INPUT_NUM provided ({num}) is not an integer")
|
||||
print(num**2)
|
||||
else:
|
||||
num = 1
|
Loading…
Reference in a new issue