From f456e3ef20dc83ee4445400e91a05514c5981a25 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 14:49:52 -0600 Subject: [PATCH 01/11] arbitrary change remove trailing line break --- src/components/callout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/callout.js b/src/components/callout.js index c5a5c7e294..7109724429 100644 --- a/src/components/callout.js +++ b/src/components/callout.js @@ -12,4 +12,4 @@ const Callout = ({ type, children, title, link }) => { ) } -export default Callout +export default Callout \ No newline at end of file From 4ef7edc4682d1f3859af87031468429a1034822a Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 15:34:28 -0600 Subject: [PATCH 02/11] another arbitrary change to trigger prettier --- src/components/callout.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/callout.js b/src/components/callout.js index 7109724429..1b553a2431 100644 --- a/src/components/callout.js +++ b/src/components/callout.js @@ -11,5 +11,4 @@ const Callout = ({ type, children, title, link }) => { ) } - export default Callout \ No newline at end of file From fd5a9e9b087de81a3b4e188accf0753d8ed849c5 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:12:41 -0600 Subject: [PATCH 03/11] temporarily remove paths --- .github/workflows/prettier.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index bf8218362d..ee08cfac01 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -2,9 +2,9 @@ name: Prettier on: pull_request: - paths: - - 'src/**/*.{js,jsx,ts,tsx}' - - '.github/workflows/prettier.yml' + # paths: + # - 'src/**/*.{js,jsx,ts,tsx}' + # - '.github/workflows/prettier.yml' types: - opened - synchronize From e48ebfe71ec8bc8d64234238becc7cd11a0cfd56 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:14:46 -0600 Subject: [PATCH 04/11] simplify path --- .github/workflows/prettier.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index ee08cfac01..7fa08e838a 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -2,9 +2,9 @@ name: Prettier on: pull_request: - # paths: - # - 'src/**/*.{js,jsx,ts,tsx}' - # - '.github/workflows/prettier.yml' + paths: + - 'src/**/*.js' + - '.github/workflows/prettier.yml' types: - opened - synchronize From ab69d60c8e49827f1b2a6bc84998447f3888d3c5 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:19:56 -0600 Subject: [PATCH 05/11] join the filenames into a single line --- .github/workflows/prettier.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 7fa08e838a..38b7f44f23 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -38,7 +38,9 @@ jobs: echo "Fixing the following files:" echo "$CHANGED_FILES" echo "$CHANGED_FILES" | xargs npx prettier --write - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + # Join the filenames into a single line with space separation + JOINED_FILES=$(echo "$CHANGED_FILES" | tr '\n' ' ') + echo "CHANGED_FILES=$JOINED_FILES" >> $GITHUB_ENV else echo "No files to format" fi From 833e267ea49f6a3c1a5a315ca7cc907f8369f1ba Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:23:02 -0600 Subject: [PATCH 06/11] push to the current branch --- .github/workflows/prettier.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 38b7f44f23..cc63e8efbb 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -54,7 +54,13 @@ jobs: git config user.email "bot@getpantheon.com" git add . git commit -m "Apply Prettier formatting" - git push + + # Extract the branch name from GITHUB_REF + BRANCH_NAME=${GITHUB_REF#refs/heads/} + + # Push the commit to the branch + git push origin HEAD:$BRANCH_NAME + DIFF_OUTPUT=$(git diff HEAD~1 HEAD) echo "DIFF_OUTPUT<> $GITHUB_ENV echo "$DIFF_OUTPUT" >> $GITHUB_ENV From 6e9fbb7b4f01af9fd5c8e6496d1dae7afeb99f25 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:26:01 -0600 Subject: [PATCH 07/11] use GITHUB_HEAD_REF --- .github/workflows/prettier.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index cc63e8efbb..2e1f7eef45 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -55,11 +55,8 @@ jobs: git add . git commit -m "Apply Prettier formatting" - # Extract the branch name from GITHUB_REF - BRANCH_NAME=${GITHUB_REF#refs/heads/} - # Push the commit to the branch - git push origin HEAD:$BRANCH_NAME + git push origin HEAD:$GITHUB_HEAD_REF DIFF_OUTPUT=$(git diff HEAD~1 HEAD) echo "DIFF_OUTPUT<> $GITHUB_ENV From 956a63eabd678808f5c0b557ce25f08b5a78cb35 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:29:59 -0600 Subject: [PATCH 08/11] update the comment --- .github/workflows/prettier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 2e1f7eef45..654ce237fb 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -70,7 +70,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | if [ -n "${{ env.DIFF_OUTPUT }}" ]; then - gh pr comment ${{ github.event.pull_request.number }} --body "$(echo -e "Hi from your friendly robot! 🤖\n\nI've applied Prettier formatting to the following files:\n\n${{ env.CHANGED_FILES }}\n\nThe full diff is below:\n\n
\nClick to expand\n\n\`\`\`diff\n$DIFF_OUTPUT\n\`\`\`\n
")" + gh pr comment ${{ github.event.pull_request.number }} --body "$(echo -e "Hi from your friendly robot! 🤖\n\nI've applied Prettier formatting to the following files in $CURRENT_COMMIT:\n\n\`${{ env.CHANGED_FILES }}\`\n\nThe full diff is below. Please review the changes.\n\n
\nClick to expand\n\n\`\`\`diff\n$DIFF_OUTPUT\n\`\`\`\n
")" else echo "No Prettier changes" fi \ No newline at end of file From bf4f5e1a514dc9ab4062dac545ef6c84da118a0e Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 15 Aug 2024 16:32:32 -0600 Subject: [PATCH 09/11] get current commit --- .github/workflows/prettier.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 654ce237fb..b4f483d22b 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -70,6 +70,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | if [ -n "${{ env.DIFF_OUTPUT }}" ]; then + CURRENT_COMMIT=$(git rev-parse --short HEAD) gh pr comment ${{ github.event.pull_request.number }} --body "$(echo -e "Hi from your friendly robot! 🤖\n\nI've applied Prettier formatting to the following files in $CURRENT_COMMIT:\n\n\`${{ env.CHANGED_FILES }}\`\n\nThe full diff is below. Please review the changes.\n\n
\nClick to expand\n\n\`\`\`diff\n$DIFF_OUTPUT\n\`\`\`\n
")" else echo "No Prettier changes" From 04daac3d452063a7a68ef6ca02a7e8072d3a3fa3 Mon Sep 17 00:00:00 2001 From: Pantheon Bot Date: Thu, 15 Aug 2024 22:33:40 +0000 Subject: [PATCH 10/11] Apply Prettier formatting --- src/components/callout.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/callout.js b/src/components/callout.js index 1b553a2431..77e8df6283 100644 --- a/src/components/callout.js +++ b/src/components/callout.js @@ -1,5 +1,5 @@ -import React from "react" -import ExternalLink from "./externalLink" +import React from 'react'; +import ExternalLink from './externalLink'; const Callout = ({ type, children, title, link }) => { return ( @@ -9,6 +9,6 @@ const Callout = ({ type, children, title, link }) => { {children} - ) -} -export default Callout \ No newline at end of file + ); +}; +export default Callout; From ba4a11d493059494ebf2bf9ee334d0cd74e36ba6 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 11 Oct 2024 13:47:49 -0600 Subject: [PATCH 11/11] intentionally add breaking code --- src/components/callout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/callout.js b/src/components/callout.js index 77e8df6283..e00ee86a7f 100644 --- a/src/components/callout.js +++ b/src/components/callout.js @@ -1,5 +1,5 @@ -import React from 'react'; -import ExternalLink from './externalLink'; +import React from "react"; +import ExternalLink from "./externalLink"; const Callout = ({ type, children, title, link }) => { return ( @@ -9,6 +9,6 @@ const Callout = ({ type, children, title, link }) => { {children} - ); -}; + ) +} export default Callout;