From fd7edaa429c92f77afe03189e87aca75409664ca Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 10:36:42 +0530 Subject: [PATCH 01/18] Create configlet-sync.yml Add configlet-sync.yml --- .github/workflows/configlet-sync.yml | 93 ++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/configlet-sync.yml diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml new file mode 100644 index 0000000..6373e5d --- /dev/null +++ b/.github/workflows/configlet-sync.yml @@ -0,0 +1,93 @@ +name: Configlet Auto Sync + +on: + workflow_dispatch: + schedule: + - cron: '0 0 15 * *' + +jobs: + sync-docs-metadata: + timeout-minutes: 10 + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Fetch configlet + run: ./bin/fetch-configlet + + - name: Run configlet sync for files + run: ./bin/configlet sync --docs --metadata --filepaths -u -y + + - name: Create pull request if changes + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "🤖 Auto-sync docs, metadata, and filepaths" + title: "🤖 Configlet sync: docs, metadata, and filepaths" + body: | + This PR was generated automatically by a scheduled workflow. + + It includes updates from `configlet sync` for: + - 📄 Documentation + - 🧭 Metadata + - 🗂️ Filepaths + + Please review and merge if everything looks good! + branch: configlet-auto-sync + delete-branch: true + + check-test-sync: + timeout-minutes: 10 + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Fetch configlet + run: ./bin/fetch-configlet + + - name: Run configlet sync for test and capture output + id: sync_test + run: | + configlet_raw_output="$(./bin/configlet sync --tests | tee .github/sync-test-output.txt)" + + echo "configlet output:" + echo "$configlet_raw_output" + + echo '```' > .github/sync-test-output.txt + echo "$configlet_raw_output" >> .github/sync-test-output.txt + echo '```' >> .github/sync-test-output.txt + + echo "output<> "$GITHUB_OUTPUT" + echo "$configlet_raw_output" >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + - name: Find existing issue for test sync + id: find_issue + if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ISSUE_TITLE="🚨 configlet sync --test found unsynced tests" + ISSUE_DATA=$(gh issue list --search "is:issue is:open in:title \"${ISSUE_TITLE}\" repo:${{ github.repository }}" --json number,title --jq '.[0]') + + if [ -z "$ISSUE_DATA" ]; then + echo "No open issue found with title: '${ISSUE_TITLE}'. A new one will be created." + echo "issue_number=" >> $GITHUB_OUTPUT + else + ISSUE_NUMBER=$(echo "$ISSUE_DATA" | jq -r '.number') + echo "Found existing issue number: $ISSUE_NUMBER for title: '$ISSUE_TITLE'" + echo "issue_number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT + fi + + - name: Create or Update issue if tests are not synced + if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} + uses: peter-evans/create-issue-from-file@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "🚨 configlet sync --test found unsynced tests" + content-filepath: .github/sync-test-output.txt + issue-number: ${{ steps.find_issue.outputs.issue_number || '' }} From 051bc0cef6a17e2d7602fedb988d9295a3742e6a Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 18:50:26 +0530 Subject: [PATCH 02/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 6373e5d..253d71e 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -75,7 +75,7 @@ jobs: ISSUE_DATA=$(gh issue list --search "is:issue is:open in:title \"${ISSUE_TITLE}\" repo:${{ github.repository }}" --json number,title --jq '.[0]') if [ -z "$ISSUE_DATA" ]; then - echo "No open issue found with title: '${ISSUE_TITLE}'. A new one will be created." + printf "No open issue found with title: '%s'. A new one will be created.\n" "${ISSUE_TITLE}" echo "issue_number=" >> $GITHUB_OUTPUT else ISSUE_NUMBER=$(echo "$ISSUE_DATA" | jq -r '.number') From c22a44473c324e35d04b8198a307aefb05bc2f01 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 18:55:39 +0530 Subject: [PATCH 03/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 253d71e..a85f2ee 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -78,7 +78,7 @@ jobs: printf "No open issue found with title: '%s'. A new one will be created.\n" "${ISSUE_TITLE}" echo "issue_number=" >> $GITHUB_OUTPUT else - ISSUE_NUMBER=$(echo "$ISSUE_DATA" | jq -r '.number') + ISSUE_NUMBER=$(jq -r '.number' <<< "$ISSUE_DATA") echo "Found existing issue number: $ISSUE_NUMBER for title: '$ISSUE_TITLE'" echo "issue_number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT fi From 32068b7f33d92d48e890eb62240d9650d8ea8366 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 19:20:49 +0530 Subject: [PATCH 04/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index a85f2ee..1a0f7cf 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -52,18 +52,11 @@ jobs: - name: Run configlet sync for test and capture output id: sync_test run: | - configlet_raw_output="$(./bin/configlet sync --tests | tee .github/sync-test-output.txt)" + configlet_raw_output="$(./bin/configlet sync --tests)" - echo "configlet output:" - echo "$configlet_raw_output" - - echo '```' > .github/sync-test-output.txt - echo "$configlet_raw_output" >> .github/sync-test-output.txt - echo '```' >> .github/sync-test-output.txt - - echo "output<> "$GITHUB_OUTPUT" - echo "$configlet_raw_output" >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" + printf "configlet output:\n%s\n" "$configlet_raw_output" + printf '```\n%s\n```\n' "$configlet_raw_output" > .github/sync-test-output.txt + printf 'output< "$GITHUB_OUTPUT" - name: Find existing issue for test sync id: find_issue From e69b50670d90d55f93476dd0dc33694fb6b77f93 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 20:01:54 +0530 Subject: [PATCH 05/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 1a0f7cf..3894a11 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -67,7 +67,7 @@ jobs: ISSUE_TITLE="🚨 configlet sync --test found unsynced tests" ISSUE_DATA=$(gh issue list --search "is:issue is:open in:title \"${ISSUE_TITLE}\" repo:${{ github.repository }}" --json number,title --jq '.[0]') - if [ -z "$ISSUE_DATA" ]; then + if [[ -z "$ISSUE_DATA" ]]; then printf "No open issue found with title: '%s'. A new one will be created.\n" "${ISSUE_TITLE}" echo "issue_number=" >> $GITHUB_OUTPUT else From e9fa3bf50a45bba0c6100f4b176b04f4dc5f6043 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 20:07:23 +0530 Subject: [PATCH 06/18] Update configlet-sync.yml to use temp dir --- .github/workflows/configlet-sync.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 3894a11..f52f1cb 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -55,7 +55,8 @@ jobs: configlet_raw_output="$(./bin/configlet sync --tests)" printf "configlet output:\n%s\n" "$configlet_raw_output" - printf '```\n%s\n```\n' "$configlet_raw_output" > .github/sync-test-output.txt + mkdir -p temp + printf '```\n%s\n```\n' "$configlet_raw_output" > temp/sync-test-output.txt printf 'output< "$GITHUB_OUTPUT" - name: Find existing issue for test sync @@ -82,5 +83,5 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} title: "🚨 configlet sync --test found unsynced tests" - content-filepath: .github/sync-test-output.txt + content-filepath: temp/sync-test-output.txt issue-number: ${{ steps.find_issue.outputs.issue_number || '' }} From 4fbaa980c63b514550b6ae627568aadf79d46bcd Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Tue, 24 Jun 2025 23:52:01 +0530 Subject: [PATCH 07/18] Update configlet-sync.yml --- .github/workflows/configlet-sync.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index f52f1cb..ce6ebb4 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -52,19 +52,20 @@ jobs: - name: Run configlet sync for test and capture output id: sync_test run: | - configlet_raw_output="$(./bin/configlet sync --tests)" + configlet_raw_output="$(./bin/configlet sync --tests 2>&1 || true)" printf "configlet output:\n%s\n" "$configlet_raw_output" - mkdir -p temp - printf '```\n%s\n```\n' "$configlet_raw_output" > temp/sync-test-output.txt printf 'output< "$GITHUB_OUTPUT" - - name: Find existing issue for test sync + - name: Format test sync output and find existing issue id: find_issue if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + mkdir -p temp + printf '```\n%s\n```\n' "${{ steps.sync_test.outputs.output }}" > temp/sync-test-output.txt + ISSUE_TITLE="🚨 configlet sync --test found unsynced tests" ISSUE_DATA=$(gh issue list --search "is:issue is:open in:title \"${ISSUE_TITLE}\" repo:${{ github.repository }}" --json number,title --jq '.[0]') From 07032b3765232ede0c24137668444a8baf8ec842 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Wed, 25 Jun 2025 00:11:47 +0530 Subject: [PATCH 08/18] Use /tmp file --- .github/workflows/configlet-sync.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index ce6ebb4..d0d08b5 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -63,8 +63,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mkdir -p temp - printf '```\n%s\n```\n' "${{ steps.sync_test.outputs.output }}" > temp/sync-test-output.txt + printf '```\n%s\n```\n' "${{ steps.sync_test.outputs.output }}" > /tmp/sync-test-output.txt ISSUE_TITLE="🚨 configlet sync --test found unsynced tests" ISSUE_DATA=$(gh issue list --search "is:issue is:open in:title \"${ISSUE_TITLE}\" repo:${{ github.repository }}" --json number,title --jq '.[0]') @@ -84,5 +83,5 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} title: "🚨 configlet sync --test found unsynced tests" - content-filepath: temp/sync-test-output.txt + content-filepath: /tmp/sync-test-output.txt issue-number: ${{ steps.find_issue.outputs.issue_number || '' }} From a2f337bf704803c8b9d64273558fe4ea5409977b Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Thu, 26 Jun 2025 23:36:07 +0530 Subject: [PATCH 09/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index d0d08b5..fb6dd25 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -70,7 +70,7 @@ jobs: if [[ -z "$ISSUE_DATA" ]]; then printf "No open issue found with title: '%s'. A new one will be created.\n" "${ISSUE_TITLE}" - echo "issue_number=" >> $GITHUB_OUTPUT + echo "issue_number=" >> "$GITHUB_OUTPUT" else ISSUE_NUMBER=$(jq -r '.number' <<< "$ISSUE_DATA") echo "Found existing issue number: $ISSUE_NUMBER for title: '$ISSUE_TITLE'" From e33554a2bb6902cbd46bff051583628b5de13a39 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Thu, 26 Jun 2025 23:36:16 +0530 Subject: [PATCH 10/18] Update .github/workflows/configlet-sync.yml Co-authored-by: Isaac Good --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index fb6dd25..1fc5736 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -74,7 +74,7 @@ jobs: else ISSUE_NUMBER=$(jq -r '.number' <<< "$ISSUE_DATA") echo "Found existing issue number: $ISSUE_NUMBER for title: '$ISSUE_TITLE'" - echo "issue_number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT + echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT" fi - name: Create or Update issue if tests are not synced From aea575835ed47ea9deebeeb1eb9a2ab700190d4d Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Thu, 26 Jun 2025 23:56:55 +0530 Subject: [PATCH 11/18] Pin actions/checkout to SHA --- .github/workflows/configlet-sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 1fc5736..2e7265b 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: Fetch configlet run: ./bin/fetch-configlet @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: Fetch configlet run: ./bin/fetch-configlet From 200fa6b63a008da6f20ccf5935aee76937dc4588 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 00:00:15 +0530 Subject: [PATCH 12/18] Pin peter-evans/create-pull-request to SHA --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 2e7265b..800c8f4 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -21,7 +21,7 @@ jobs: run: ./bin/configlet sync --docs --metadata --filepaths -u -y - name: Create pull request if changes - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "🤖 Auto-sync docs, metadata, and filepaths" From 9b402cd9623bd883ade8d644d84061c07203fba4 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 00:01:02 +0530 Subject: [PATCH 13/18] Pin peter-evans/create-issue-from-file to SHA --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 800c8f4..7ef1057 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -79,7 +79,7 @@ jobs: - name: Create or Update issue if tests are not synced if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} - uses: peter-evans/create-issue-from-file@v5 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd with: token: ${{ secrets.GITHUB_TOKEN }} title: "🚨 configlet sync --test found unsynced tests" From 01e2cafbbd51b389cf5fd96e6d64336dfa2f0b35 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 00:57:45 +0530 Subject: [PATCH 14/18] Switch to exit_code verification --- .github/workflows/configlet-sync.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 7ef1057..b35f8d2 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -52,14 +52,19 @@ jobs: - name: Run configlet sync for test and capture output id: sync_test run: | - configlet_raw_output="$(./bin/configlet sync --tests 2>&1 || true)" + set +e + configlet_raw_output="$(./bin/configlet sync --tests 2>&1)" + exit_code=$? + set -e + + echo "exit_code=$exit_code" >> "$GITHUB_OUTPUT" + printf "output<> "$GITHUB_OUTPUT" printf "configlet output:\n%s\n" "$configlet_raw_output" - printf 'output< "$GITHUB_OUTPUT" - name: Format test sync output and find existing issue id: find_issue - if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} + if: ${{ steps.sync_test.outputs.exit_code != 0 }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -78,7 +83,7 @@ jobs: fi - name: Create or Update issue if tests are not synced - if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }} + if: ${{ steps.sync_test.outputs.exit_code != 0 }} uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd with: token: ${{ secrets.GITHUB_TOKEN }} From ed6d9f744e485198c9e9cac0f188795fd7955fc7 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 01:09:11 +0530 Subject: [PATCH 15/18] Switch to reusable --- .github/workflows/configlet-sync.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index b35f8d2..3153ab2 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -1,9 +1,7 @@ name: Configlet Auto Sync on: - workflow_dispatch: - schedule: - - cron: '0 0 15 * *' + workflow_call: jobs: sync-docs-metadata: From a024c8a4e79a1243bf52a8226d2130efce6dec2b Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 01:40:24 +0530 Subject: [PATCH 16/18] Specify using bash {0} Co-authored-by: Glenn Jackman --- .github/workflows/configlet-sync.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index 3153ab2..b4f91d2 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -49,15 +49,12 @@ jobs: - name: Run configlet sync for test and capture output id: sync_test + shell: bash {0} run: | - set +e configlet_raw_output="$(./bin/configlet sync --tests 2>&1)" exit_code=$? - set -e - echo "exit_code=$exit_code" >> "$GITHUB_OUTPUT" printf "output<> "$GITHUB_OUTPUT" - printf "configlet output:\n%s\n" "$configlet_raw_output" - name: Format test sync output and find existing issue From 820a7ac9b9428fc3aad80066aa9e71149fcceda9 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 08:47:24 +0530 Subject: [PATCH 17/18] Remove STDERR part --- .github/workflows/configlet-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index b4f91d2..c4d4b0e 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -51,7 +51,7 @@ jobs: id: sync_test shell: bash {0} run: | - configlet_raw_output="$(./bin/configlet sync --tests 2>&1)" + configlet_raw_output="$(./bin/configlet sync --tests)" exit_code=$? echo "exit_code=$exit_code" >> "$GITHUB_OUTPUT" printf "output<> "$GITHUB_OUTPUT" From 240a3dd56979f04864ee366fe2c229e5c6bca46d Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 27 Jun 2025 09:03:24 +0530 Subject: [PATCH 18/18] Replace all echo with printf --- .github/workflows/configlet-sync.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/configlet-sync.yml b/.github/workflows/configlet-sync.yml index c4d4b0e..52a9f46 100644 --- a/.github/workflows/configlet-sync.yml +++ b/.github/workflows/configlet-sync.yml @@ -53,7 +53,7 @@ jobs: run: | configlet_raw_output="$(./bin/configlet sync --tests)" exit_code=$? - echo "exit_code=$exit_code" >> "$GITHUB_OUTPUT" + printf "exit_code=%d\n" "$exit_code" >> "$GITHUB_OUTPUT" printf "output<> "$GITHUB_OUTPUT" printf "configlet output:\n%s\n" "$configlet_raw_output" @@ -70,11 +70,11 @@ jobs: if [[ -z "$ISSUE_DATA" ]]; then printf "No open issue found with title: '%s'. A new one will be created.\n" "${ISSUE_TITLE}" - echo "issue_number=" >> "$GITHUB_OUTPUT" + printf "issue_number=\n" >> "$GITHUB_OUTPUT" else ISSUE_NUMBER=$(jq -r '.number' <<< "$ISSUE_DATA") - echo "Found existing issue number: $ISSUE_NUMBER for title: '$ISSUE_TITLE'" - echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT" + printf "Found existing issue number: %s for title: %s\n" "$ISSUE_NUMBER" "$ISSUE_TITLE" + printf "issue_number=%s\n" "$ISSUE_NUMBER" >> "$GITHUB_OUTPUT" fi - name: Create or Update issue if tests are not synced