Skip to content

Commit 9b606ed

Browse files
check if pyproject.toml was actually changed by sed
1 parent bc31cda commit 9b606ed

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/famedly-tests.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,14 @@ jobs:
398398
fi
399399
400400
- name: Update dependency to the current branch
401+
working-directory: synapse-invite-checker
401402
run: |
402403
sed -i 's|matrix-synapse @ git+.*|matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}|' pyproject.toml
404+
# Check if the file was actually modified
405+
if git diff --exit-code pyproject.toml > /dev/null; then
406+
echo "::error::The sed command did not modify pyproject.toml. Check if the 'matrix-synapse' dependency exists in the file."
407+
exit 1
408+
fi
403409
404410
- name: Run invite-checker tests
405411
working-directory: synapse-invite-checker
@@ -443,7 +449,12 @@ jobs:
443449
- name: Update dependency to the current branch
444450
working-directory: synapse-token-authenticator
445451
run: |
446-
sed -i 's|matrix-synapse @ git+.*|matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}|' pyproject.toml
452+
sed -i 's|"matrix-synapse[^"]*"|"matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}"|' pyproject.toml
453+
# Check if the file was actually modified
454+
if git diff --exit-code pyproject.toml > /dev/null; then
455+
echo "::error::The sed command did not modify pyproject.toml. Check if the 'matrix-synapse' dependency exists in the file."
456+
exit 1
457+
fi
447458
448459
- name: Run token-authenticator tests
449460
working-directory: synapse-token-authenticator

0 commit comments

Comments
 (0)