Tool for flattening include statements in GitHub actions workflow.yml files.
Project description
actions-includes
Allows including an action inside another action (by preprocessing the Yaml file).
Instead of using uses
or run
in your action step, use the keyword includes
.
Once you are using the includes
argument, the workflows can be expanded using
the tool like follows;
# python -m actions_include <input-workflow-with-includes> <output-workflow-flattened>
python -m actions_includes ./.github/workflows-src/workflow-a.yml ./.github/workflows/workflow-a.yml
includes:
step
steps:
- name: Other step
run: |
command
- includes: {action-name}
with:
{inputs}
- name: Other step
run: |
command
The {action-name}
follows the same syntax as the standard GitHub action
uses
and the action referenced should look exactly like a
GitHub "composite action"
except runs.using
should be includes
.
For example;
{owner}/{repo}@{ref}
- Public action ingithub.com/{owner}/{repo}
{owner}/{repo}/{path}@{ref}
- Public action under{path}
ingithub.com/{owner}/{repo}
../{path}
- Local action under local{path}, IE
./.github/actions/my-action`.
As it only makes sense to reference composite actions, the docker://
form isn't supported.
As you frequently want to include local actions, actions-includes
extends the
{action-name}
syntax to also support;
/{name}
- Local action under./.github/actions/{name}
.
This is how composite actions should have worked.
includes-script:
step
File: script.py
print('Hello world')
File: workflow.yml
steps: - name: Other step run: | command - name: Hello includes-script: script.py - name: Other step run: | command
python -m actions_includes.py workflow.in.yml workflow.out.yml
File: oworkflow.out.yml
steps: - name: Other step run: | command - name: Hello shell: python run: | print('Hello world') - name: Other step run: | command
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for actions-includes-0.0.post70.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6dd1c1173d03528da3fb4d477d42f43658f3129b457d42a8b72af05ceb28da6 |
|
MD5 | 15fcf5897808ef18d209c9deb9615341 |
|
BLAKE2b-256 | 6be5d9816efd696eeb7e76d70f80f6174e637c0161758f370ac23b22e12e1da7 |
Hashes for actions_includes-0.0.post70-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6d51d237106bf3fa927e8352b8b0ff5f8ed6dd43e311ac1acfac4e1dc761399 |
|
MD5 | 135d648faed8d5fcd83dfbac90c38b8f |
|
BLAKE2b-256 | 65da9e109768271fe0b7abcf1a025eb0f148cf7ed370803a1ef3fbd2e8e24e54 |
Hashes for actions_includes-0.0.post70-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e3e75381650e1afb1cf80003f32488a390b6f82d14aad7dd7a4324f6f03b6ad |
|
MD5 | eb223aea2b7b6d9ec58dadb88f5ad0b7 |
|
BLAKE2b-256 | fd171dace8928432f9a9679cb5f79a9d2af6e991d266e4d2cf7939913687175d |
Hashes for actions_includes-0.0.post70-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae924ee5ef2bf2e6ff60ea4f420d90a18406e96b79df5e72491611f63f90886 |
|
MD5 | faca3b35decf402c488f31903f5d4e24 |
|
BLAKE2b-256 | 8a77e7df562ba6e8d2eb14244a5c013616181421e49c9973e90ab46bebac5a4a |