https://github.com/anna-money/workflow-tools
CLI tools for GitHub Actions
https://github.com/anna-money/workflow-tools
ci-cd cli github-actions github-secrets github-workflows python
Last synced: 4 months ago
JSON representation
CLI tools for GitHub Actions
- Host: GitHub
- URL: https://github.com/anna-money/workflow-tools
- Owner: anna-money
- License: apache-2.0
- Created: 2020-03-17T10:56:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T10:40:11.000Z (over 1 year ago)
- Last Synced: 2025-08-26T12:37:22.136Z (4 months ago)
- Topics: ci-cd, cli, github-actions, github-secrets, github-workflows, python
- Language: Python
- Homepage: https://workflow-tools.readthedocs.io/
- Size: 113 KB
- Stars: 26
- Watchers: 17
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
workflow-tools
==============
|Build| |Black| |License|
.. raw:: html

CLI tools for GitHub Actions.
- Automate writing GitHub workflow configs with a generator tool
- Automate setting GitHub secrets for repositories
- Integrate the tools into your pipeline for setting up new microservices
Rationale
---------
Microservice architecture may have dozens and dozens of lookalikes services that require similar CI/CD workflows.
With infrastructure as code approach taken by the `GitHub Actions`_, why not using workflows generation?
Setting up a new microservice repository may also be automated. This is where ``workflow-tools`` come in handy.
Examples
--------
Let's set `GitHub Secrets`_ for a repository. First, get a `personal access token`_ in GitHub settings.
Then set up a secret using ``workflow-tools``:
.. code-block:: bash
workflow_secret --owner=anna-money --repo=workflow-tools \
--token="YOUR-PERSONAL-ACCESS-TOKEN" \
update --key=MY_SECRET_KEY --value=MY_VALUE
Now let's use a fragment of `Jinja2`_ template for a GitHub Actions workflow to generate resulting config:
.. code-block:: bash
WORKFLOW_RUNNER_VERSION=ubuntu-latest WORKFLOW_PYTHON27=2.7 WORKFLOW_PYTHON37=3.7 \
workflow_generator
# Press Enter to start pasting Jinja2 workflow template into stdin
jobs:
test:
runs-on: [[ workflow.runner_version ]]
strategy:
matrix:
python:
- [[ workflow.python27 ]]
- [[ workflow.python37 ]]
# Press Ctrl+D to render resulting workflow
# For real workflow templates use reading/writing from/to a file, load variables from envfile
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- 2.7
- 3.7
Help
----
See `documentation`_ for more details. Use ``--help`` flag for each tool in the package.
Installation
------------
Just run:
.. code-block:: bash
pip install -U workflow-tools
Contributing
------------
See `CONTRIBUTING.rst`_.
.. |Build| image:: https://github.com/anna-money/workflow-tools/workflows/master/badge.svg
:target: https://github.com/anna-money/workflow-tools/actions?query=workflow%3Amaster
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black
:alt: Black Formatter
.. |License| image:: https://img.shields.io/github/license/anna-money/workflow-tools.svg
:alt: GitHub License
.. _GitHub Actions: https://help.github.com/en/actions
.. _GitHub Secrets: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
.. _personal access token: https://github.com/settings/tokens
.. _Jinja2: https://jinja.palletsprojects.com/
.. _documentation: https://workflow-tools.readthedocs.io/
.. _CONTRIBUTING.rst: https://github.com/anna-money/workflow-tools/tree/master/CONTRIBUTING.rst