Support for `includes-script` in custom places
It would be nice to be able to include scripts in custom places with custom tags.
For example, it would be nice if a script could be inserted using the command tag in when using the nick-invision/retry action
Any idea on what could be a workable syntax?
Perhaps something like this?
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script: [ "command", script.py ]
This should expand to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
shell: python
command: |
<script.py content>
Option 1
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script:
command: script.py
should expand to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
shell: python
command: |
<script.py content>
Then also;
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script: script.py
is equivalent to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script:
runs: script.py
Option 2 -- outputs dictionary
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script:
uses: script.py
outputs:
script: command
shell: shell-type
should expand to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
shell-type: python
command: |
<script.py content>
Then also;
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script: script.py
is equivalent to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
includes-script:
uses: script.py
outputs:
script: runs
shell: shell
Option 3 -- includes-script under key
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command:
includes-script: script.py
should expand to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
shell-type: python
command: |
<script.py content>
Then also;
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
runs:
includes-script: script.py
is equivalent to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
runs: |
<script>
Option 4 - !include
Use same syntax as https://github.com/codeindulgence/yaml-includes and https://www.home-assistant.io/docs/configuration/splitting_configuration/ and https://pypi.org/project/pyyaml-include/
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: !include: script.py
should expand to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
shell-type: python
command: |
<script.py content>
Then also;
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
runs: !include: script.py
is equivalent to
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
runs: |
<script>
GitHub
Adds support for the YAML include directive as defined by the [RAML spec]. - codeindulgence/yaml-includes
Home Assistant
Splitting the configuration.yaml into several files.
PyPI
Extending PyYAML with a custom constructor for including YAML files within YAML files
Another action that might benefit from this: https://github.com/marketplace/actions/github-script
GitHub
Run simple scripts using the GitHub client