Skip to content

Commit 9f7a666

Browse files
use yq instead of sed
1 parent 9b606ed commit 9f7a666

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/famedly-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,12 @@ jobs:
400400
- name: Update dependency to the current branch
401401
working-directory: synapse-invite-checker
402402
run: |
403-
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
403+
yq -i -p toml -o toml \
404+
'(.tool.hatch.envs.default.dependencies[] | select(test("^matrix-synapse"))) = "matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}"' \
405+
pyproject.toml
404406
# Check if the file was actually modified
405407
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."
408+
echo "::error::The yq command did not modify pyproject.toml. Check if the 'matrix-synapse' dependency exists in tool.hatch.envs.default.dependencies."
407409
exit 1
408410
fi
409411

0 commit comments

Comments
 (0)