Skip to content

Commit

Permalink
Add suffix to sed -i to make in MAC compatible and fix prepare_shop
Browse files Browse the repository at this point in the history
  • Loading branch information
joernott committed Aug 27, 2024
1 parent 8e229a9 commit f65ace7
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/oxid-esales/defaults/scripts/check_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi
[[ ${RESULT} -gt 0 ]] && exit 1

# shellcheck disable=SC2016
sed -e 's|(.*)\r|$1|' -i "${PATTERN_FILE}"
sed -e 's|(.*)\r|$1|' -i.backup "${PATTERN_FILE}"
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${LOG_FILE}"; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
FILES=$(find . -iname '*.yml' -o -name "*.yaml")
for FILE in ${FILES}; do
sed -E 's|OXID-eSales/github-actions/(.*)@v([0-9][0-9]*)|OXID-eSales/github-actions/\1@v${{ inputs.major}}|g' \
-i "${FILE}"
-i.backup "${FILE}"
done
STATUS=$(git status -s)
if [ -n "${STATUS}" ]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/universal_workflow_light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
if [ '${{ github.event_name }}' == 'pull_request' ]; then
REF=$(echo '{{ .Github.HeadRef }}'|sed -e 's|/refs/heads/||')
# This is the git ref name
sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
# This is the same for composer but with an added dev- prefix
sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
fi
TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/universal_workflow_light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
if [ '${{ github.event_name }}' == 'pull_request' ]; then
REF=$(echo '{{ .Github.HeadRef }}'|sed -e 's|/refs/heads/||')
# This is the git ref name
sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
sed -e "s|safe_ref_name:.*|safe_ref_name: ${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
# This is the same for composer but with an added dev- prefix
sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
sed -e "s|ref_name: dev-.*|ref_name: dev-${REF}|" -i.backup '${{ inputs.plan_folder }}/defaults/defaults_light.yaml'
fi
TESTPLAN=$(echo "${{ inputs.testplan }}"|sed -e 's|~|${{ inputs.plan_folder }}|g')
Expand Down
2 changes: 1 addition & 1 deletion append_report/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ runs:
rm debug/debug.sh
fi
if [ -n "${{ inputs.github_token }}" ]; then
sed -e 's|${{ inputs.github_token}}|${DEBUG_GH_TOKEN}|g' -i "${DEBUG_FILE}"
sed -e 's|${{ inputs.github_token}}|${DEBUG_GH_TOKEN}|g' -i.backup "${DEBUG_FILE}"
fi
cat >>"${DEBUG_FILE}" <<EODS
end_job "$DEBUG_NAME"
Expand Down
2 changes: 1 addition & 1 deletion codeception/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${{ inputs.logfile }}"; then
Expand Down
2 changes: 1 addition & 1 deletion phpcs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${{ inputs.logfile }}"; then
Expand Down
2 changes: 1 addition & 1 deletion phpmd/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${FILE}"; then
Expand Down
2 changes: 1 addition & 1 deletion phpstan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${FILE}"; then
Expand Down
2 changes: 1 addition & 1 deletion phpunit/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${{ inputs.logfile }}"; then
Expand Down
6 changes: 3 additions & 3 deletions prepare_shop/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ runs:
${{ inputs.debug }}
mkdir -p source
curl -sSjkLo source/composer.json \
-H 'Authorization: Bearer ${{ inputs.enterprise_github_token }}' \
-H "Authorization: Bearer ${{ inputs.enterprise_github_token }}" \
-H 'Accept: application/vnd.github.raw+json' \
'${{ inputs.compilation_url }}'
Expand Down Expand Up @@ -476,7 +476,7 @@ runs:
else
echo -e "\033[0;35mAllow dev-${{ inputs.github_ref_name }} for oxid-esales requires\033[0m"
sed -e 's#"oxid-esales/\(.*\)":[[:space:]]*"${{ inputs.composer_dev_ref }}"#"oxid-esales/\1": "dev-${{ inputs.github_ref_name }} || ${{ inputs.composer_dev_ref }}"#' \
-i '${{ inputs.composer_file }}'
-i.backup '${{ inputs.composer_file }}'
fi
fi
touch module_repositories.json
Expand Down Expand Up @@ -514,7 +514,7 @@ runs:
cat >targets.tmp <<EOF
${{ inputs.copy_script_targets }}
EOF
sed -e 's|(.*)\r|$1|' -i targets.tmp
sed -e 's|(.*)\r|$1|' -i.backup targets.tmp
while read -r TARGET ; do
mkdir -p "source/${TARGET}"
for FILE in $(find .github/oxid-esales/defaults/scripts -iname "*.sh" -o -iname "*.txt"); do
Expand Down
2 changes: 1 addition & 1 deletion run_custom_scripts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ runs:
${{ inputs.custom_script_container }}
EOF
# This is necessary due to the 'EOF' now
sed -e 's|^ ||' -i source/custom_script.sh
sed -e 's|^ ||' -i.backup source/custom_script.sh
chmod 0755 source/custom_script.sh
docker compose ${{ inputs.container_method }} -T \
${{ inputs.container_options }} \
Expand Down
2 changes: 1 addition & 1 deletion runtests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ runs:
cat >failure_pattern.tmp <<EOF
${{ inputs.failure_pattern}}
EOF
sed -e 's|(.*)\r|$1|' -i failure_pattern.tmp
sed -e 's|(.*)\r|$1|' -i.backup failure_pattern.tmp
while read -r LINE ; do
if [ -n "${LINE}" ]; then
if grep -q -E "${LINE}" "${{ inputs.logfile }}"; then
Expand Down
4 changes: 2 additions & 2 deletions sonarcloud/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ runs:
for FILE in $(find coverage-reports -iname 'coverage*.xml'); do
echo -e "\033[0;35mFixing paths in ${FILE}\033[0m"
cp "${FILE}" "${FILE}.orig"
sed -e 's|${{ inputs.strip_path }}||' -i ${FILE}
sed -e 's|${{ inputs.strip_path }}||' -i.backup ${FILE}
COVERAGE_FILES="${COVERAGE_FILES},${FILE}"
# diff -y --color=always "${FILE}.orig" "${FILE}" || true
done
Expand All @@ -99,7 +99,7 @@ runs:
for FILE in $(find coverage-reports -iname 'phpunit*.xml'); do
echo -e "\033[0;35mFixing paths in ${FILE}\033[0m"
cp "${FILE}" "${FILE}.orig"
sed -e 's|${{ inputs.strip_path }}||' -i ${FILE}
sed -e 's|${{ inputs.strip_path }}||' -i.backup ${FILE}
PHPUNIT_FILES="${PHPUNIT_FILES},${FILE}"
# diff -y --color=always "${FILE}.orig" "${FILE}" || true
done
Expand Down
2 changes: 1 addition & 1 deletion start_shop/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ runs:
set -e
curl -sSjkL http://selenium:4444/wd/hub/status
EOF
sed -e 's|^ *||' -i source/wait_for_selenium.sh
sed -e 's|^ *||' -i.backup source/wait_for_selenium.sh
chmod 0755 source/wait_for_selenium.sh
docker compose exec -T \
${{ inputs.container_name}} \
Expand Down

0 comments on commit f65ace7

Please sign in to comment.