From 9865f7314ca4d756a0f03da6bf8de9365da2ceec Mon Sep 17 00:00:00 2001 From: Marcos Martins Date: Mon, 20 May 2024 09:53:26 -0300 Subject: [PATCH 1/3] ci(workflow): move 'generate_cli_screenshots' steps to 'docspublish' Since the purpose is to updated the CLI screenshots on Github Pages, combining this two workflows makes sense. --- .github/workflows/docspublish.yml | 31 +++++++++++++++ .../workflows/generate_cli_screenshots.yml | 39 ------------------- 2 files changed, 31 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/generate_cli_screenshots.yml diff --git a/.github/workflows/docspublish.yml b/.github/workflows/docspublish.yml index d95b464b40..1ac8e7f5e3 100644 --- a/.github/workflows/docspublish.yml +++ b/.github/workflows/docspublish.yml @@ -6,13 +6,44 @@ on: - master jobs: + update-cli-screenshots: + 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: Update CLI screenshots + run: | + poetry run python scripts/gen_cli_help_screenshots.py + - name: Commit and push updated 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" -m "[skip ci]" + git push + publish-documentation: runs-on: ubuntu-latest + needs: update-cli-screenshots steps: - uses: actions/checkout@v4 with: token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" fetch-depth: 0 + - name: Pull latest changes + run: | + git pull origin master - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/generate_cli_screenshots.yml b/.github/workflows/generate_cli_screenshots.yml deleted file mode 100644 index 7bbc8b16d9..0000000000 --- a/.github/workflows/generate_cli_screenshots.yml +++ /dev/null @@ -1,39 +0,0 @@ -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 From 09c6ba78110138075b4c0fe495ce795c3b14091a Mon Sep 17 00:00:00 2001 From: Marcos Martins Date: Mon, 20 May 2024 11:38:18 -0300 Subject: [PATCH 2/3] ci: exclude *.svg files from trailing whitespace hook --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3c9a02544..163e7a0ab3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,7 @@ repos: exclude: "tests/((commands|data)/|test_).+" - id: trailing-whitespace args: [ --markdown-linebreak-ext=md ] + exclude: '\.svg$' - id: debug-statements - id: no-commit-to-branch - id: check-merge-conflict From 4f0569d5ad960a2cfc1c48ce00514da9cfc2ae96 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Tue, 21 May 2024 00:04:23 +0800 Subject: [PATCH 3/3] ci(docpublish): reword cli screenshot generation commit message --- .github/workflows/docspublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docspublish.yml b/.github/workflows/docspublish.yml index 1ac8e7f5e3..4ac9a3a4a4 100644 --- a/.github/workflows/docspublish.yml +++ b/.github/workflows/docspublish.yml @@ -30,7 +30,7 @@ jobs: 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" -m "[skip ci]" + git commit -m "docs(cli/screenshots): update CLI screenshots" -m "[skip ci]" git push publish-documentation: