Skip to content

Commit

Permalink
ISSUE-318: replace \n with \r\n only in composer lock diff contents
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-aveiga committed May 27, 2024
1 parent 516b9a4 commit 558266c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tasks/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tasks:
- defer: rm -f /tmp/drainpipe-composer-lock-diff-pr
- |
LOCK_DIFF="$(composer global exec -- "composer-lock-diff --md")"
LOCK_DIFF=$(echo "$LOCK_DIFF" | sed ':a;N;$!ba;s/\n/\r\n/g')
sed -i 's/<!--Composer Lock Diff-->.*<!--\/Composer Lock Diff-->//g' /tmp/drainpipe-composer-lock-diff-pr
DESCRIPTION=$(cat /tmp/drainpipe-composer-lock-diff-pr | jq -r '.body')
if [ "$(cat /tmp/drainpipe-composer-lock-diff)" != "" ]; then
Expand All @@ -42,5 +43,4 @@ tasks:
$DIFF
<!--/Composer Lock Diff-->"
fi
DESCRIPTION=$(echo "$DESCRIPTION" | sed ':a;N;$!ba;s/\n/\r\n/g' | sed -z 's/"/\\"/g')
echo "$(jq -n --arg description "$DESCRIPTION" '{"body": $description}')" > {{ .json_file }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"body": "<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->\r\\r\\n\r\\r\\n# Relates to:\r\\r\\nFixes <!-- Add issue number here, with preceding #. e.g. Fixes #123 -->\r\\r\\n<!-- The \\\"Fixes\\\" language will automatically close the issue when this PR is merged. We think that is a good default. If more follow ups are needed, more PRs can be created, and the issue manually re-opened. -->\r\\r\\n\r\\r\\n<!-- This risks section is to be filled out before final review and merge. -->\r\\r\\n# Risks\r\\r\\n<!--\r\\r\\nLow, medium, large. List what kind of risks, and what could be affected.\r\\r\\n-->\r\\r\\n\r\\r\\n# Background\r\\r\\n## What does this PR do?\r\\r\\n\r\\r\\n## What kind of change is this?\r\\r\\n<!--\r\\r\\nBug fixes (non-breaking change which fixes an issue)\r\\r\\nImprovements (misc. changes to existing features)\r\\r\\nFeatures (non-breaking change which adds functionality)\r\\r\\nUpdates (new versions of included code)\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- This \\\"Why\\\" section is most relevant if there is no linked issue explaining why. If there is a related issue it might make sense to skip this why section. -->\r\\r\\n<!--\r\\r\\n## Why are we doing this? Any context or related work?\r\\r\\n-->\r\\r\\n\r\\r\\n# Documentation changes needed?\r\\r\\n<!--\r\\r\\nMy changes do not require a change to the project documentation.\r\\r\\nMy changes require a change to the project documentation.\r\\r\\nIf a docs change is needed: I have updated the documentation accordingly.\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker. -->\r\\r\\n# Testing\r\\r\\n## Where should a reviewer start?\r\\r\\n\r\\r\\n## Detailed testing steps\r\\r\\n<!--\r\\r\\nNone, automtated tests are fine.\r\\r\\n-->\r\\r\\n\r\\r\\n<!--\r\\r\\n- As [anon/admin], go to [link]\r\\r\\n - [do action]\r\\r\\n - verify [result]\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- If there is a UI change, please include before and after screenshots or videos. This will speed up PRs being merged. It is extra nice to annotate screenshots with arrows or boxes pointing out the differences. -->\r\\r\\n<!--\r\\r\\n## Screenshots\r\\r\\n### Before\r\\r\\n### After\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- If there is anything about the deploy, please make a note. -->\r\\r\\n<!--\r\\r\\n# Deploy Notes\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- Copy and paste commandline output. -->\r\\r\\n<!--\r\\r\\n## Database changes\r\\r\\n-->\r\\r\\n\r\\r\\n<!-- If there is something more than the automated steps, please specifiy deploy instructions. -->\r\\r\\n<!--\r\\r\\n## Deployment instructions\r\\r\\n-->\r\\r\\n<!--Composer Lock Diff-->\\r\\n## Composer Lock Diff\\r\\n| Production Changes | From | To | Compare |\\r\\n|--------------------|------|-------|---------|\\r\\n| sebastian/version | NEW | 4.0.1 | |\\r\\n<!--/Composer Lock Diff-->"
"body": "<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->\r\n\r\n# Relates to:\r\nFixes <!-- Add issue number here, with preceding #. e.g. Fixes #123 -->\r\n<!-- The \"Fixes\" language will automatically close the issue when this PR is merged. We think that is a good default. If more follow ups are needed, more PRs can be created, and the issue manually re-opened. -->\r\n\r\n<!-- This risks section is to be filled out before final review and merge. -->\r\n# Risks\r\n<!--\r\nLow, medium, large. List what kind of risks, and what could be affected.\r\n-->\r\n\r\n# Background\r\n## What does this PR do?\r\n\r\n## What kind of change is this?\r\n<!--\r\nBug fixes (non-breaking change which fixes an issue)\r\nImprovements (misc. changes to existing features)\r\nFeatures (non-breaking change which adds functionality)\r\nUpdates (new versions of included code)\r\n-->\r\n\r\n<!-- This \"Why\" section is most relevant if there is no linked issue explaining why. If there is a related issue it might make sense to skip this why section. -->\r\n<!--\r\n## Why are we doing this? Any context or related work?\r\n-->\r\n\r\n# Documentation changes needed?\r\n<!--\r\nMy changes do not require a change to the project documentation.\r\nMy changes require a change to the project documentation.\r\nIf a docs change is needed: I have updated the documentation accordingly.\r\n-->\r\n\r\n<!-- Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker. -->\r\n# Testing\r\n## Where should a reviewer start?\r\n\r\n## Detailed testing steps\r\n<!--\r\nNone, automtated tests are fine.\r\n-->\r\n\r\n<!--\r\n- As [anon/admin], go to [link]\r\n - [do action]\r\n - verify [result]\r\n-->\r\n\r\n<!-- If there is a UI change, please include before and after screenshots or videos. This will speed up PRs being merged. It is extra nice to annotate screenshots with arrows or boxes pointing out the differences. -->\r\n<!--\r\n## Screenshots\r\n### Before\r\n### After\r\n-->\r\n\r\n<!-- If there is anything about the deploy, please make a note. -->\r\n<!--\r\n# Deploy Notes\r\n-->\r\n\r\n<!-- Copy and paste commandline output. -->\r\n<!--\r\n## Database changes\r\n-->\r\n\r\n<!-- If there is something more than the automated steps, please specifiy deploy instructions. -->\r\n<!--\r\n## Deployment instructions\r\n-->\r\n<!--Composer Lock Diff-->\r\n## Composer Lock Diff\r\n| Production Changes | From | To | Compare |\r\n|--------------------|------|-------|---------|\r\n| sebastian/version | NEW | 4.0.1 | |\r\n<!--/Composer Lock Diff-->\r\n"
}
2 changes: 1 addition & 1 deletion tests/fixtures/composer-lock-diff/github/pr-template.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"body": "<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->\r\r\n\r\r\n# Relates to:\r\r\nFixes <!-- Add issue number here, with preceding #. e.g. Fixes #123 -->\r\r\n<!-- The \\\"Fixes\\\" language will automatically close the issue when this PR is merged. We think that is a good default. If more follow ups are needed, more PRs can be created, and the issue manually re-opened. -->\r\r\n\r\r\n<!-- This risks section is to be filled out before final review and merge. -->\r\r\n# Risks\r\r\n<!--\r\r\nLow, medium, large. List what kind of risks, and what could be affected.\r\r\n-->\r\r\n\r\r\n# Background\r\r\n## What does this PR do?\r\r\n\r\r\n## What kind of change is this?\r\r\n<!--\r\r\nBug fixes (non-breaking change which fixes an issue)\r\r\nImprovements (misc. changes to existing features)\r\r\nFeatures (non-breaking change which adds functionality)\r\r\nUpdates (new versions of included code)\r\r\n-->\r\r\n\r\r\n<!-- This \\\"Why\\\" section is most relevant if there is no linked issue explaining why. If there is a related issue it might make sense to skip this why section. -->\r\r\n<!--\r\r\n## Why are we doing this? Any context or related work?\r\r\n-->\r\r\n\r\r\n# Documentation changes needed?\r\r\n<!--\r\r\nMy changes do not require a change to the project documentation.\r\r\nMy changes require a change to the project documentation.\r\r\nIf a docs change is needed: I have updated the documentation accordingly.\r\r\n-->\r\r\n\r\r\n<!-- Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker. -->\r\r\n# Testing\r\r\n## Where should a reviewer start?\r\r\n\r\r\n## Detailed testing steps\r\r\n<!--\r\r\nNone, automtated tests are fine.\r\r\n-->\r\r\n\r\r\n<!--\r\r\n- As [anon/admin], go to [link]\r\r\n - [do action]\r\r\n - verify [result]\r\r\n-->\r\r\n\r\r\n<!-- If there is a UI change, please include before and after screenshots or videos. This will speed up PRs being merged. It is extra nice to annotate screenshots with arrows or boxes pointing out the differences. -->\r\r\n<!--\r\r\n## Screenshots\r\r\n### Before\r\r\n### After\r\r\n-->\r\r\n\r\r\n<!-- If there is anything about the deploy, please make a note. -->\r\r\n<!--\r\r\n# Deploy Notes\r\r\n-->\r\r\n\r\r\n<!-- Copy and paste commandline output. -->\r\r\n<!--\r\r\n## Database changes\r\r\n-->\r\r\n\r\r\n<!-- If there is something more than the automated steps, please specifiy deploy instructions. -->\r\r\n<!--\r\r\n## Deployment instructions\r\r\n-->\r\r\n<!--Composer Lock Diff-->\r\n## Composer Lock Diff\r\n| Production Changes | From | To | Compare |\r\n|--------------------|------|-------|---------|\r\n| sebastian/version | NEW | 4.0.1 | |\r\n<!--/Composer Lock Diff-->"
"body": "<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->\r\n\r\n# Relates to:\r\nFixes <!-- Add issue number here, with preceding #. e.g. Fixes #123 -->\r\n<!-- The \"Fixes\" language will automatically close the issue when this PR is merged. We think that is a good default. If more follow ups are needed, more PRs can be created, and the issue manually re-opened. -->\r\n\r\n<!-- This risks section is to be filled out before final review and merge. -->\r\n# Risks\r\n<!--\r\nLow, medium, large. List what kind of risks, and what could be affected.\r\n-->\r\n\r\n# Background\r\n## What does this PR do?\r\n\r\n## What kind of change is this?\r\n<!--\r\nBug fixes (non-breaking change which fixes an issue)\r\nImprovements (misc. changes to existing features)\r\nFeatures (non-breaking change which adds functionality)\r\nUpdates (new versions of included code)\r\n-->\r\n\r\n<!-- This \"Why\" section is most relevant if there is no linked issue explaining why. If there is a related issue it might make sense to skip this why section. -->\r\n<!--\r\n## Why are we doing this? Any context or related work?\r\n-->\r\n\r\n# Documentation changes needed?\r\n<!--\r\nMy changes do not require a change to the project documentation.\r\nMy changes require a change to the project documentation.\r\nIf a docs change is needed: I have updated the documentation accordingly.\r\n-->\r\n\r\n<!-- Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker. -->\r\n# Testing\r\n## Where should a reviewer start?\r\n\r\n## Detailed testing steps\r\n<!--\r\nNone, automtated tests are fine.\r\n-->\r\n\r\n<!--\r\n- As [anon/admin], go to [link]\r\n - [do action]\r\n - verify [result]\r\n-->\r\n\r\n<!-- If there is a UI change, please include before and after screenshots or videos. This will speed up PRs being merged. It is extra nice to annotate screenshots with arrows or boxes pointing out the differences. -->\r\n<!--\r\n## Screenshots\r\n### Before\r\n### After\r\n-->\r\n\r\n<!-- If there is anything about the deploy, please make a note. -->\r\n<!--\r\n# Deploy Notes\r\n-->\r\n\r\n<!-- Copy and paste commandline output. -->\r\n<!--\r\n## Database changes\r\n-->\r\n\r\n<!-- If there is something more than the automated steps, please specifiy deploy instructions. -->\r\n<!--\r\n## Deployment instructions\r\n-->\r\n"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"body": "[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Type | Update | Change |\r\n|---|---|---|---|\r\n| [drupal/upgrade_status](http://drupal.org/project/upgrade_status) ([source](https://git.drupalcode.org/project/upgrade_status.git)) | require-dev | minor | `^3.18.0` -> `^3.19.0` |\r\n\r\n---\r\n\r\n### ⚠ Dependency Lookup Warnings ⚠\r\n\r\nWarnings were logged while processing this repo. Please check the Dependency Dashboard for more information.\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\r\n\r\n---\r\n\r\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Lullabot/lullabot.com-d8).\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40MC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->\r\n<!--Composer Lock Diff-->\r\n## Composer Lock Diff\r\n| Production Changes | From | To | Compare |\r\n|--------------------|------|-------|---------|\r\n| sebastian/version | NEW | 4.0.1 | |\r\n<!--/Composer Lock Diff-->"
"body": "[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Type | Update | Change |\r\n|---|---|---|---|\r\n| [drupal/upgrade_status](http://drupal.org/project/upgrade_status) ([source](https://git.drupalcode.org/project/upgrade_status.git)) | require-dev | minor | `^3.18.0` -> `^3.19.0` |\r\n\r\n---\r\n\r\n### ⚠ Dependency Lookup Warnings ⚠\r\n\r\nWarnings were logged while processing this repo. Please check the Dependency Dashboard for more information.\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\r\n\r\n---\r\n\r\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Lullabot/lullabot.com-d8).\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40MC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->\r\n<!--Composer Lock Diff-->\r\n## Composer Lock Diff\r\n| Production Changes | From | To | Compare |\r\n|--------------------|------|-------|---------|\r\n| sebastian/version | NEW | 4.0.1 | |\r\n<!--/Composer Lock Diff-->\r\n"
}

0 comments on commit 558266c

Please sign in to comment.