-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
31 lines (31 loc) · 886 Bytes
/
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
# action.yaml
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"
outputs:
num_squared:
description: 'Square of the input'
# need to specify the extra `value` field for `composite` actions
value: ${{ steps.get-square.outputs.num_squared }}
runs:
using: 'composite'
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install -r requirements.txt
shell: bash
- name: Pass Inputs to Shell
run: |
echo "INPUT_NUM=${{ inputs.num }}" >> $GITHUB_ENV
shell: bash
- name: Fetch the number's square
id: get-square
run: python src/get_num_square.py
shell: bash