From f4e25016bc5e4200ea28d3fb72de31bb326ab748 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 16:34:59 +0200 Subject: [PATCH 01/23] Readme command usage --- action.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index 8754a97..406e855 100644 --- a/action.yml +++ b/action.yml @@ -232,15 +232,17 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | - output_file=$(atmos docs generate ${{ inputs.target }} 2>&1 | sed -n -e "s/^.*output=//p") - # Get relative path from absolute - output_file=$(realpath -s --relative-to="$PWD" "$output_file") - # Ignore changes if they are only whitespace - if ! git diff --quiet ${output_file} && git diff --ignore-all-space --ignore-blank-lines --quiet ${output_file}; then - git restore ${output_file} - echo Ignoring whitespace-only changes in generated file - fi - echo "file=${output_file}" >> $GITHUB_OUTPUT + atmos ${{ inputs.target }} + # Get all changed files and process them + changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) + for file in $changed_files; do + # Ignore changes if they are only whitespace + if ! git diff --quiet "$file" && git diff --ignore-all-space --ignore-blank-lines --quiet "$file"; then + git restore "$file" + echo "Ignoring whitespace-only changes in generated file: $file" + fi + done + echo "file=$(echo $changed_files | tr '\n' ' ')" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' @@ -302,8 +304,6 @@ runs: add-paths: | ${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }} - **/README.md - docs/* body: |- ## what This is an auto-generated PR that updates the README.md and docs From 86b6e173d0c8ded97575bf604953c7b23c010cbe Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 18:03:13 +0200 Subject: [PATCH 02/23] fix readme action --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 406e855..30a95e8 100644 --- a/action.yml +++ b/action.yml @@ -38,10 +38,10 @@ inputs: required: false default: 'true' - target: - description: "Configuration name" + command: + description: "Atmos command to generate readme" required: true - default: 'readme' + default: 'docs generate readme' validate_readme: required: false @@ -232,7 +232,7 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | - atmos ${{ inputs.target }} + atmos ${{ inputs.command }} # Get all changed files and process them changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) for file in $changed_files; do From c0eff7fd085b607f5dfedb63093441f08a2020d8 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 19:13:42 +0300 Subject: [PATCH 03/23] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 30a95e8..f6bf0fd 100644 --- a/action.yml +++ b/action.yml @@ -234,6 +234,7 @@ runs: run: | atmos ${{ inputs.command }} # Get all changed files and process them + git status --porcelain changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) for file in $changed_files; do # Ignore changes if they are only whitespace From e0220bfc1eca78ed6278eea64b9d507a4a4ca67d Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 18:30:23 +0200 Subject: [PATCH 04/23] Fix action.yml --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 30a95e8..3e65cf0 100644 --- a/action.yml +++ b/action.yml @@ -232,9 +232,11 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | + set -e atmos ${{ inputs.command }} # Get all changed files and process them changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) + set +e for file in $changed_files; do # Ignore changes if they are only whitespace if ! git diff --quiet "$file" && git diff --ignore-all-space --ignore-blank-lines --quiet "$file"; then From aea4b75e3309aa592d71469acffb78a5a2ee352a Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 22:11:32 +0300 Subject: [PATCH 05/23] Update action.yml --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 34fe30a..136132e 100644 --- a/action.yml +++ b/action.yml @@ -235,16 +235,20 @@ runs: set -e atmos ${{ inputs.command }} # Get all changed files and process them - git status --porcelain + echo "1" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) + echo "2" set +e for file in $changed_files; do + echo "3" # Ignore changes if they are only whitespace if ! git diff --quiet "$file" && git diff --ignore-all-space --ignore-blank-lines --quiet "$file"; then + echo "4" git restore "$file" echo "Ignoring whitespace-only changes in generated file: $file" fi done + echo "5" echo "file=$(echo $changed_files | tr '\n' ' ')" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 From 9ee474469f5bee1ed8d327bc9d038953bb85dac8 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 22:15:45 +0300 Subject: [PATCH 06/23] Update action.yml --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 136132e..2748aa2 100644 --- a/action.yml +++ b/action.yml @@ -236,6 +236,12 @@ runs: atmos ${{ inputs.command }} # Get all changed files and process them echo "1" + git status --porcelain + echo "1 - 1" + git status --porcelain | grep "^ M" + echo "1 - 2" + git status --porcelain | grep "^ M" | cut -c4- + echo "1 - 3" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) echo "2" set +e From e29936b76462c40361ad811f630b4898b73bca7f Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 22:39:20 +0300 Subject: [PATCH 07/23] Update action.yml --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2748aa2..3315e45 100644 --- a/action.yml +++ b/action.yml @@ -232,7 +232,7 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | - set -e + set -o pipefail atmos ${{ inputs.command }} # Get all changed files and process them echo "1" @@ -243,6 +243,7 @@ runs: git status --porcelain | grep "^ M" | cut -c4- echo "1 - 3" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) + set +o pipefail echo "2" set +e for file in $changed_files; do From 93da31277d2766b68f266f50631b39dabe28ff01 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 22:42:26 +0300 Subject: [PATCH 08/23] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3315e45..8900218 100644 --- a/action.yml +++ b/action.yml @@ -232,7 +232,7 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | - set -o pipefail + set +o pipefail atmos ${{ inputs.command }} # Get all changed files and process them echo "1" @@ -243,7 +243,7 @@ runs: git status --porcelain | grep "^ M" | cut -c4- echo "1 - 3" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) - set +o pipefail + set -o pipefail echo "2" set +e for file in $changed_files; do From 566f1ba64b079b50984500e2d86c1778c4a30be1 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 21 Aug 2025 22:44:35 +0300 Subject: [PATCH 09/23] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 8900218..8ae3173 100644 --- a/action.yml +++ b/action.yml @@ -232,7 +232,7 @@ runs: env: GITHUB_TOKEN: "${{ inputs.token }}" run: | - set +o pipefail + set +e atmos ${{ inputs.command }} # Get all changed files and process them echo "1" @@ -243,7 +243,7 @@ runs: git status --porcelain | grep "^ M" | cut -c4- echo "1 - 3" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) - set -o pipefail + set -e echo "2" set +e for file in $changed_files; do From 6f4589bdc59d690775936b33f6df1d92fc43a7d2 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 00:27:28 +0300 Subject: [PATCH 10/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8ae3173..86a12c5 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - echo "file=$(echo $changed_files | tr '\n' ' ')" >> $GITHUB_OUTPUT + echo "file=$(echo $changed_files | tr '\n' ',')" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' From 186602098ba59b7e98529b3bd452327c1cd640cf Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 00:31:13 +0300 Subject: [PATCH 11/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 86a12c5..c62b47e 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - echo "file=$(echo $changed_files | tr '\n' ',')" >> $GITHUB_OUTPUT + echo "file=$(echo $changed_files | tr ' ',')" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' From 26e6b1217e55c050b239da29d4499aa77b7ee825 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 00:34:37 +0300 Subject: [PATCH 12/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c62b47e..645b4ba 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - echo "file=$(echo $changed_files | tr ' ',')" >> $GITHUB_OUTPUT + echo "file=${changed_files// /,}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' From 81755d75d1e4cabd7afa068418d839bdd5bbf58c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 01:46:13 +0300 Subject: [PATCH 13/23] Update action.yml --- action.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 645b4ba..e02a737 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,11 @@ runs: fi done echo "5" - echo "file=${changed_files// /,}" >> $GITHUB_OUTPUT + OLDIFS="$IFS" + IFS="," + files="${changed_files[*]}" + IFS="$OLDIFS" + echo "file=${files}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' @@ -276,7 +280,7 @@ runs: commit_user_name: "${{ inputs.commit_user_name }}" commit_user_email: "${{ inputs.commit_user_email }}" commit_author: "${{ inputs.commit_author }}" - file_pattern: '${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }}' + file_pattern: '${{ steps.banner.outputs.file }},${{ steps.readme.outputs.file }}' push_options: '${{ inputs.commit_push_options }}' - uses: actions/github-script@v7 @@ -316,8 +320,7 @@ runs: committer: ${{ inputs.commit_author }} sign-commits: ${{ inputs.sign-commits }} add-paths: | - ${{ steps.banner.outputs.file }} - ${{ steps.readme.outputs.file }} + ${{ steps.banner.outputs.file }},${{ steps.readme.outputs.file }} body: |- ## what This is an auto-generated PR that updates the README.md and docs From 03300333930ec07d4f0aa8b128df5ffe95b21baf Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 01:49:39 +0300 Subject: [PATCH 14/23] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index e02a737..b793977 100644 --- a/action.yml +++ b/action.yml @@ -260,6 +260,7 @@ runs: IFS="," files="${changed_files[*]}" IFS="$OLDIFS" + echo "6" echo "file=${files}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 From 91c658ada2806ce385047da39caf40921fc08bb5 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 01:53:51 +0300 Subject: [PATCH 15/23] Add echo statement for changed files in action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index b793977..e5e27aa 100644 --- a/action.yml +++ b/action.yml @@ -261,6 +261,7 @@ runs: files="${changed_files[*]}" IFS="$OLDIFS" echo "6" + echo "${files}" echo "file=${files}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 From 03a5e182424128a3dfb38300de09ca55c7d698b7 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 01:58:25 +0300 Subject: [PATCH 16/23] Update action.yml --- action.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/action.yml b/action.yml index e5e27aa..53c50b3 100644 --- a/action.yml +++ b/action.yml @@ -256,10 +256,7 @@ runs: fi done echo "5" - OLDIFS="$IFS" - IFS="," - files="${changed_files[*]}" - IFS="$OLDIFS" + files="${changed_files}" echo "6" echo "${files}" echo "file=${files}" >> $GITHUB_OUTPUT From 77955a01c1b98cbe845bc7562b64d1aec44c0aa3 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 02:01:15 +0300 Subject: [PATCH 17/23] Fix file variable assignment in action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 53c50b3..0d3710b 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - files="${changed_files}" + files="$(changed_files | tr '\n' ',')" echo "6" echo "${files}" echo "file=${files}" >> $GITHUB_OUTPUT From 94c9bcb413367494a13a9c9ba6a9c0303f25a7ab Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 02:03:45 +0300 Subject: [PATCH 18/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0d3710b..afca553 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - files="$(changed_files | tr '\n' ',')" + files="$(echo ${changed_files} | tr '\n' ',')" echo "6" echo "${files}" echo "file=${files}" >> $GITHUB_OUTPUT From 3e83905740c32bfbd0cda219e116c6aeaa3e60c7 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 02:06:24 +0300 Subject: [PATCH 19/23] Fix file assignment to handle changed files correctly --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index afca553..fb2cde7 100644 --- a/action.yml +++ b/action.yml @@ -256,7 +256,7 @@ runs: fi done echo "5" - files="$(echo ${changed_files} | tr '\n' ',')" + files="$(echo ${changed_files})" echo "6" echo "${files}" echo "file=${files}" >> $GITHUB_OUTPUT From 12b3c94b191547f0fe520ed7b9b429faf3c2203f Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 02:08:41 +0300 Subject: [PATCH 20/23] Format changed_files output for GitHub Actions --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index fb2cde7..979fce8 100644 --- a/action.yml +++ b/action.yml @@ -258,8 +258,8 @@ runs: echo "5" files="$(echo ${changed_files})" echo "6" - echo "${files}" - echo "file=${files}" >> $GITHUB_OUTPUT + echo "${files// /,}" + echo "file=${files// /,}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' From 2d409997c2336cfc9431a50859fad4a5df54ce6e Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 02:13:40 +0300 Subject: [PATCH 21/23] Update action.yml --- action.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/action.yml b/action.yml index 979fce8..4f5e13c 100644 --- a/action.yml +++ b/action.yml @@ -235,30 +235,16 @@ runs: set +e atmos ${{ inputs.command }} # Get all changed files and process them - echo "1" - git status --porcelain - echo "1 - 1" - git status --porcelain | grep "^ M" - echo "1 - 2" - git status --porcelain | grep "^ M" | cut -c4- - echo "1 - 3" changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) set -e - echo "2" - set +e for file in $changed_files; do - echo "3" # Ignore changes if they are only whitespace if ! git diff --quiet "$file" && git diff --ignore-all-space --ignore-blank-lines --quiet "$file"; then - echo "4" git restore "$file" echo "Ignoring whitespace-only changes in generated file: $file" fi done - echo "5" files="$(echo ${changed_files})" - echo "6" - echo "${files// /,}" echo "file=${files// /,}" >> $GITHUB_OUTPUT - uses: gaurav-nelson/github-action-markdown-link-check@v1 From 84ac402546cccdec8ddd5b8849e228719938711f Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 23 Aug 2025 03:47:56 +0300 Subject: [PATCH 22/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4f5e13c..1d55469 100644 --- a/action.yml +++ b/action.yml @@ -235,7 +235,7 @@ runs: set +e atmos ${{ inputs.command }} # Get all changed files and process them - changed_files=$(git status --porcelain | grep "^ M" | cut -c4-) + changed_files=$(git status --porcelain | grep -E "^\s?(M|\?\?)" | cut -c4-) set -e for file in $changed_files; do # Ignore changes if they are only whitespace From c59779d749b2fcd702e9a81475b3700e9d226d42 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 9 Sep 2025 18:55:55 +0300 Subject: [PATCH 23/23] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1d55469..4473fb6 100644 --- a/action.yml +++ b/action.yml @@ -265,7 +265,7 @@ runs: commit_user_name: "${{ inputs.commit_user_name }}" commit_user_email: "${{ inputs.commit_user_email }}" commit_author: "${{ inputs.commit_author }}" - file_pattern: '${{ steps.banner.outputs.file }},${{ steps.readme.outputs.file }}' + file_pattern: '${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }}' push_options: '${{ inputs.commit_push_options }}' - uses: actions/github-script@v7