Skip to main content

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 in github.com/{owner}/{repo}
  • {owner}/{repo}/{path}@{ref} - Public action under {path} in github.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

actions-includes-0.0.post70.tar.gz (26.1 kB view details)

Uploaded Source

Built Distributions

actions_includes-0.0.post70-py3.9.egg (33.1 kB view details)

Uploaded Source

actions_includes-0.0.post70-py3.8.egg (33.2 kB view details)

Uploaded Source

actions_includes-0.0.post70-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file actions-includes-0.0.post70.tar.gz.

File metadata

  • Download URL: actions-includes-0.0.post70.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for actions-includes-0.0.post70.tar.gz
Algorithm Hash digest
SHA256 c6dd1c1173d03528da3fb4d477d42f43658f3129b457d42a8b72af05ceb28da6
MD5 15fcf5897808ef18d209c9deb9615341
BLAKE2b-256 6be5d9816efd696eeb7e76d70f80f6174e637c0161758f370ac23b22e12e1da7

See more details on using hashes here.

File details

Details for the file actions_includes-0.0.post70-py3.9.egg.

File metadata

  • Download URL: actions_includes-0.0.post70-py3.9.egg
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for actions_includes-0.0.post70-py3.9.egg
Algorithm Hash digest
SHA256 c6d51d237106bf3fa927e8352b8b0ff5f8ed6dd43e311ac1acfac4e1dc761399
MD5 135d648faed8d5fcd83dfbac90c38b8f
BLAKE2b-256 65da9e109768271fe0b7abcf1a025eb0f148cf7ed370803a1ef3fbd2e8e24e54

See more details on using hashes here.

File details

Details for the file actions_includes-0.0.post70-py3.8.egg.

File metadata

  • Download URL: actions_includes-0.0.post70-py3.8.egg
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for actions_includes-0.0.post70-py3.8.egg
Algorithm Hash digest
SHA256 9e3e75381650e1afb1cf80003f32488a390b6f82d14aad7dd7a4324f6f03b6ad
MD5 eb223aea2b7b6d9ec58dadb88f5ad0b7
BLAKE2b-256 fd171dace8928432f9a9679cb5f79a9d2af6e991d266e4d2cf7939913687175d

See more details on using hashes here.

File details

Details for the file actions_includes-0.0.post70-py3-none-any.whl.

File metadata

  • Download URL: actions_includes-0.0.post70-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for actions_includes-0.0.post70-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae924ee5ef2bf2e6ff60ea4f420d90a18406e96b79df5e72491611f63f90886
MD5 faca3b35decf402c488f31903f5d4e24
BLAKE2b-256 8a77e7df562ba6e8d2eb14244a5c013616181421e49c9973e90ab46bebac5a4a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page