From 9955bfd95415e6ee734d3aeacb8ee0b79362e228 Mon Sep 17 00:00:00 2001 From: Marcos Martins Date: Fri, 17 May 2024 14:12:25 -0300 Subject: [PATCH] feat(ci/cd): automates the generation of CLI screenshots --- .../workflows/generate_cli_screenshots.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/generate_cli_screenshots.yml diff --git a/.github/workflows/generate_cli_screenshots.yml b/.github/workflows/generate_cli_screenshots.yml new file mode 100644 index 0000000000..7bbc8b16d9 --- /dev/null +++ b/.github/workflows/generate_cli_screenshots.yml @@ -0,0 +1,39 @@ +name: Generate CLI screenshots + +on: + pull_request: + types: + - closed + +jobs: + generate_cli_screenshots: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install -U pip poetry + poetry --version + poetry install + + - name: Generate CLI screenshots + run: | + poetry run python scripts/gen_cli_help_screenshots.py + + - name: Commit and push CLI screenshots + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add docs/images/cli_help + git commit -m "docs(cli/screenshots) update CLI screenshots" + git push