Skip to content

Use a separate GitHub Action to modify Rust dependencies #3

Use a separate GitHub Action to modify Rust dependencies

Use a separate GitHub Action to modify Rust dependencies #3

Workflow file for this run

---
name: Utils
# yamllint disable-line rule:truthy
on:
workflow_call:
# yamllint disable rule:line-length
jobs:
checkout-stratisd:
- name: Redirect Rust dependencies

Check failure on line 11 in .github/workflows/utils.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/utils.yml

Invalid workflow file

You have an error in your yaml syntax on line 11
if: github.event_name == 'pull_request'
shell: bash
run: |
set +e
# Stratis project dependencies specified in Cargo.toml
DEPENDENCIES=("devicemapper" "libblkid-rs" "libcryptsetup-rs-sys" "libcryptsetup-rs" "loopdev-3")
REPOS=("devicemapper-rs" "libblkid-rs" "libcryptsetup-rs" "libcryptsetup-rs" "loopdev-3")
TREE_ARGS=()
for (( i=0; i<${#REPOS[@]}; i++ )); do
dependency=${DEPENDENCIES[$i]}
repo=${REPOS[$i]}
cargo add $dependency --git https://github.com/jbaublitz/$repo --branch $GITHUB_HEAD_REF
jbaublitz=$?
cargo add $dependency --git https://github.com/mulkieran/$repo --branch $GITHUB_HEAD_REF
mulkieran=$?
(( jbaublitz == 0 && mulkieran == 0)) && { echo "Duplicate $repo branches"; exit 1; }
TREE_ARGS+=(--invert=$dependency)
done
cargo tree ${TREE_ARGS[@]}