Skip to content

Commit

Permalink
A0-3310: Tidy up double quotes (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikogs authored Oct 19, 2023
1 parent 69d4b5e commit 37f1782
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion check-image-existence-ecr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ runs:
run: |
image_not_exist=$(docker manifest inspect ${{ inputs.ecr-image }} &> /dev/null ; echo $?)
if [[ $image_not_exist -eq 1 ]]; then
echo "Error: docker image ${{ inputs.ecr-image }} doesn't exist"
echo 'Error: docker image ${{ inputs.ecr-image }} does not exist'
exit 1
fi
78 changes: 39 additions & 39 deletions create-featurenet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ runs:
shell: bash
run: |
cd aleph-node-compatibility
if [[ "${{ inputs.featurenet-aleph-node-image }}" != "" ]]; then
if [[ "${{ inputs.featurenet-aleph-node-image }}" == "testnet" \
|| "${{ inputs.featurenet-aleph-node-image }}" == "mainnet" ]]; then
git checkout "${{ steps.get-node-commit-sha.outputs.sha }}"
if [[ '${{ inputs.featurenet-aleph-node-image }}' != '' ]]; then
if [[ '${{ inputs.featurenet-aleph-node-image }}' == 'testnet' \
|| '${{ inputs.featurenet-aleph-node-image }}' == 'mainnet' ]]; then
git checkout '${{ steps.get-node-commit-sha.outputs.sha }}'
else
git checkout "${{ inputs.featurenet-aleph-node-image }}"
git checkout '${{ inputs.featurenet-aleph-node-image }}'
fi
else
git checkout "${{ steps.get-ref-properties.outputs.branch }}"
git checkout '${{ steps.get-ref-properties.outputs.branch }}'
fi
- name: Checkout featurenets repo
Expand All @@ -184,11 +184,11 @@ runs:
shell: bash
# yamllint disable rule:line-length
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
./Compatibility.sh "${{ github.workspace }}/aleph-node-compatibility" | grep "__output:tag:" | cut -d: -f3 > tmp-output.txt
cd '${{ inputs.repo-featurenet-template-name }}'
./Compatibility.sh '${{ github.workspace }}/aleph-node-compatibility' | grep '__output:tag:' | cut -d: -f3 > tmp-output.txt
featurenet_template_tag=$(cat tmp-output.txt)
if [[ -z "${featurenet_template_tag}" ]]; then
echo "!!! Error in getting compatible featurenet template tag"
echo '!!! Error in getting compatible featurenet template tag'
exit 1
fi
echo "featurenet-template-tag=${featurenet_template_tag}" >> $GITHUB_OUTPUT
Expand All @@ -204,37 +204,37 @@ runs:
env:
OPSSH_TARGETPATH: ${{ github.workspace }}/${{ inputs.repo-featurenets-name }}
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
cd '${{ inputs.repo-featurenet-template-name }}'
# featurenet creation from commit from PR
if [[ "${{ inputs.featurenet-aleph-node-image }}" == "" ]]; then
pr_image_tag="fe-${{ steps.get-ref-properties.outputs.branch-name-for-argo-with-sha }}"
if [[ '${{ inputs.featurenet-aleph-node-image }}' == '' ]]; then
pr_image_tag='fe-${{ steps.get-ref-properties.outputs.branch-name-for-argo-with-sha }}'
fnet_aleph_node_image="${{ inputs.ecr-public-registry }}feature-env-aleph-node:${pr_image_tag}"
fnet_bootstrap_chain_node_image="${{ steps.get-ref-properties.outputs.sha }}"
fnet_create_hook="false"
fnet_bootstrap_chain_node_image='${{ steps.get-ref-properties.outputs.sha }}'
fnet_create_hook='false'
# updatenet creation from Testnet or Mainnet image
elif [[ "${{ inputs.featurenet-aleph-node-image }}" == "testnet" || \
"${{ inputs.featurenet-aleph-node-image }}" == "mainnet" ]]; then
ecr_image_tag="${{ steps.get-node-commit-sha.outputs.sha }}"
elif [[ '${{ inputs.featurenet-aleph-node-image }}' == 'testnet' || \
'${{ inputs.featurenet-aleph-node-image }}' == 'mainnet' ]]; then
ecr_image_tag='${{ steps.get-node-commit-sha.outputs.sha }}'
fnet_aleph_node_image="${{ inputs.ecr-public-registry }}aleph-node:${ecr_image_tag}"
fnet_bootstrap_chain_node_image="${{ inputs.featurenet-aleph-node-image }}"
fnet_create_hook="false"
fnet_bootstrap_chain_node_image='${{ inputs.featurenet-aleph-node-image }}'
fnet_create_hook='false'
# updatenet update, ie updating binary to given version and runtime update
else
fnet_aleph_node_image="${{ inputs.ecr-public-registry }}aleph-node:${{ inputs.featurenet-aleph-node-image }}"
fnet_bootstrap_chain_node_image="none"
fnet_aleph_node_image='${{ inputs.ecr-public-registry }}aleph-node:${{ inputs.featurenet-aleph-node-image }}'
fnet_bootstrap_chain_node_image='none'
# Disabling hook here as work in progress
fnet_create_hook="false"
fnet_create_hook='false'
fi
./Ops.sh create-featurenet \
"${{ inputs.featurenet-name }}" \
'${{ inputs.featurenet-name }}' \
"${fnet_aleph_node_image}" \
"${fnet_bootstrap_chain_node_image}" \
"${{ inputs.rolling-update-partition }}" \
'${{ inputs.rolling-update-partition }}' \
"${fnet_create_hook}" \
"${{ inputs.replicas }}" \
"${{ inputs.internal == 'true' && 'true' || 'false' }}" | tee -a tmp-opssh-createfeaturenet-output.txt
'${{ inputs.replicas }}' \
'${{ inputs.internal == 'true' && 'true' || 'false' }}' | tee -a tmp-opssh-createfeaturenet-output.txt
ws_hostname=$(cat tmp-opssh-createfeaturenet-output.txt | grep "^__output:ws-hostname:" | cut -d: -f3)
ws_hostname=$(cat tmp-opssh-createfeaturenet-output.txt | grep '^__output:ws-hostname:' | cut -d: -f3)
echo "ws-hostname=${ws_hostname}" >> $GITHUB_OUTPUT
# yamllint enable rule:line-length

Expand All @@ -244,17 +244,17 @@ runs:
env:
OPSSH_TARGETPATH: ${{ github.workspace }}/${{ inputs.repo-featurenets-name }}
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
cd '${{ inputs.repo-featurenet-template-name }}'
./Ops.sh create-featurenet-expiration \
"${{ inputs.featurenet-name }}" \
"${{ inputs.expiration }}"
'${{ inputs.featurenet-name }}' \
'${{ inputs.expiration }}'
- name: Save template version
shell: bash
# yamllint disable rule:line-length
run: |
cd "${{ inputs.repo-featurenets-name }}"
echo "${{ steps.get-featurenet-template-tag.outputs.featurenet-template-tag }}" \
cd '${{ inputs.repo-featurenets-name }}'
echo '${{ steps.get-featurenet-template-tag.outputs.featurenet-template-tag }}' \
> fe-${{ inputs.featurenet-name }}.tag.txt
# yamllint enable rule:line-length

Expand All @@ -273,17 +273,17 @@ runs:
env:
OPSSH_TARGETPATH: "${{ github.workspace }}/${{ inputs.repo-featurenets-name }}"
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
./Ops.sh refresh-featurenets "${{ inputs.argo-host }}" \
"${{ inputs.argo-sync-user-token }}" \
"${{ inputs.featurenet-name }}" \
"${{ inputs.hard-refresh == 'true' && 'true' || 'false' }}"
cd '${{ inputs.repo-featurenet-template-name }}'
./Ops.sh refresh-featurenets '${{ inputs.argo-host }}' \
'${{ inputs.argo-sync-user-token }}' \
'${{ inputs.featurenet-name }}' \
'${{ inputs.hard-refresh == 'true' && 'true' || 'false' }}'
- name: Wait for the unique consecutive finalized heads
if: inputs.wait-for-finalized-heads == 'true'
shell: bash
env:
OPSSH_TARGETPATH: "${{ github.workspace }}/${{ inputs.repo-featurenets-name }}"
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
./Ops.sh wait-for-finalized-heads "${{ steps.start-featurenet.outputs.ws-hostname }}"
cd '${{ inputs.repo-featurenet-template-name }}'
./Ops.sh wait-for-finalized-heads '${{ steps.start-featurenet.outputs.ws-hostname }}'
24 changes: 12 additions & 12 deletions delete-featurenet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ runs:
shell: bash
# yamllint disable rule:line-length
run: |
final_name_local=${{ inputs.featurenet-name }}
final_name_local='${{ inputs.featurenet-name }}'
echo "final-featurenet-name=$final_name_local" >> $GITHUB_OUTPUT
# yamllint enable rule:line-length

Expand All @@ -75,10 +75,10 @@ runs:
shell: bash
id: get-featurenet-template-tag
run: |
cd "${{ inputs.repo-featurenets-name }}"
cd '${{ inputs.repo-featurenets-name }}'
featurenet_template_tag=main
if [[ -f "fe-${{ steps.get-final-name.outputs.final-featurenet-name }}.tag.txt" ]]; then
featurenet_template_tag=$(cat "fe-${{ steps.get-final-name.outputs.final-featurenet-name }}.tag.txt")
if [[ -f 'fe-${{ steps.get-final-name.outputs.final-featurenet-name }}.tag.txt' ]]; then
featurenet_template_tag=$(cat 'fe-${{ steps.get-final-name.outputs.final-featurenet-name }}.tag.txt')
if [[ -z "${featurenet_template_tag}" ]]; then
featurenet_template_tag=main
fi
Expand Down Expand Up @@ -108,8 +108,8 @@ runs:
env:
OPSSH_TARGETPATH: ${{ github.workspace }}/${{ inputs.repo-featurenets-name }}
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
./Ops.sh delete-featurenet "${{ steps.get-final-name.outputs.final-featurenet-name }}"
cd '${{ inputs.repo-featurenet-template-name }}'
./Ops.sh delete-featurenet '${{ steps.get-final-name.outputs.final-featurenet-name }}'
# yamllint enable rule:line-length

- name: Commit deletion of the feature environment.
Expand All @@ -127,9 +127,9 @@ runs:
env:
OPSSH_TARGETPATH: ${{ github.workspace }}/${{ inputs.repo-featurenets-name }}
run: |
cd "${{ inputs.repo-featurenet-template-name }}"
./Ops.sh refresh-featurenets "${{ inputs.argo-host }}" \
"${{ inputs.argo-sync-user-token }}"
cd '${{ inputs.repo-featurenet-template-name }}'
./Ops.sh refresh-featurenets '${{ inputs.argo-host }}' \
'${{ inputs.argo-sync-user-token }}'
- name: Clean S3 storage
shell: bash
Expand All @@ -138,7 +138,7 @@ runs:
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_REGION \
-e FEATURENETS_S3_BUCKET_NAME=${{ inputs.featurenet-keys-s3bucket-name }} \
-e FEATURENET_NAME=fe-${{ steps.get-final-name.outputs.final-featurenet-name }} \
${{ inputs.ecr-public-registry }}featurenet-helper:v0.4.0 \
-e 'FEATURENETS_S3_BUCKET_NAME=${{ inputs.featurenet-keys-s3bucket-name }}' \
-e 'FEATURENET_NAME=fe-${{ steps.get-final-name.outputs.final-featurenet-name }}' \
'${{ inputs.ecr-public-registry }}featurenet-helper:v0.4.0' \
delete-featurenet-data-from-s3
6 changes: 3 additions & 3 deletions install-rust-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL \
"https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
'https://sh.rustup.rs' | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
Expand Down Expand Up @@ -60,8 +60,8 @@ runs:
env:
CHANNEL: ${{ inputs.channel || steps.toolchain-channel.outputs.value }}
run: |
if [[ -z "${{ steps.toolchain-channel.outputs.value }}" ]]; then
echo "Could not find value for toolchain.channel in rust-toolchain.toml!"
if [[ -z '${{ steps.toolchain-channel.outputs.value }}' ]]; then
echo 'Could not find value for toolchain.channel in rust-toolchain.toml!'
exit 1
fi
rustup toolchain install ${{ env.CHANNEL }}
Expand Down
58 changes: 29 additions & 29 deletions test-upstream-merge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:
id: get-pr-branch
shell: bash
run: |
echo "pr-branch=a0-ops-upstream-automerge" >> $GITHUB_OUTPUT
echo 'pr-branch=a0-ops-upstream-automerge' >> $GITHUB_OUTPUT
- name: Get upstream repository name from URL
shell: bash
Expand Down Expand Up @@ -85,33 +85,33 @@ runs:
cd target
set +e
merge_needed="no"
git merge-base --is-ancestor "${{ steps.get-upstream-sha.outputs.sha }}" HEAD
git merge-base --is-ancestor '${{ steps.get-upstream-sha.outputs.sha }}' HEAD
if [[ $? != 0 ]]; then
merge_needed="yes"
merge_needed='yes'
fi
set -e
echo "merge=${merge_needed}" >> $GITHUB_OUTPUT
- name: Remove existing upstream merge branch if nothing to do
shell: bash
run: |
if [[ "${{ steps.check-if-merge-needed.outputs.merge }}" != "yes" ]]; then
echo "Upstream SHA is an ancestor of target branch. There is nothing to do. Removing existing auto merge branch..."
if [[ '${{ steps.check-if-merge-needed.outputs.merge }}' != 'yes' ]]; then
echo 'Upstream SHA is an ancestor of target branch. There is nothing to do. Removing existing auto merge branch...'
set +e
git push origin :${{ steps.get-pr-branch.outputs.pr-branch }}
git push origin ':${{ steps.get-pr-branch.outputs.pr-branch }}'
set -e
fi
- name: Add upstream
shell: bash
run: |
if [[ "${{ steps.check-if-merge-needed.outputs.merge }}" != "yes" ]]; then
echo "There is nothing to do."
if [[ '${{ steps.check-if-merge-needed.outputs.merge }}' != 'yes' ]]; then
echo 'There is nothing to do.'
exit 0
fi
cd target
git remote add upstream ${{ inputs.upstream-repo-url }}
git remote add upstream '${{ inputs.upstream-repo-url }}'
git fetch upstream
git remote -v
git remote show upstream
Expand All @@ -121,20 +121,20 @@ runs:
id: create-pull-request
# yamllint enable rule:line-length
run: |
if [[ "${{ steps.check-if-merge-needed.outputs.merge }}" != "yes" ]]; then
echo "There is nothing to do."
if [[ '${{ steps.check-if-merge-needed.outputs.merge }}' != 'yes' ]]; then
echo 'There is nothing to do.'
exit 0
fi
cd target
git config user.name "${{ inputs.git-commit-author }}"
git config user.email "${{ inputs.git-commit-author }}"
git config user.name '${{ inputs.git-commit-author }}'
git config user.email '${{ inputs.git-commit-author }}'
# Name of PR branch
pr_branch="${{ steps.get-pr-branch.outputs.pr-branch }}"
pr_branch='${{ steps.get-pr-branch.outputs.pr-branch }}'
# Get latest common ancestor
merge_base=$(git merge-base "${{ inputs.target-branch }}" "upstream/${{ inputs.upstream-branch }}")
merge_base=$(git merge-base '${{ inputs.target-branch }}' 'upstream/${{ inputs.upstream-branch }}')
# Remove existing branch
set +e
Expand All @@ -156,7 +156,7 @@ runs:
sleep 5
# Create a pull request
pr_title="Merge upstream from ${{ steps.get-repository-name.outputs.repository-name }}@${{ inputs.upstream-branch }} (${{ steps.get-upstream-sha.outputs.sha }})"
pr_title='Merge upstream from ${{ steps.get-repository-name.outputs.repository-name }}@${{ inputs.upstream-branch }} (${{ steps.get-upstream-sha.outputs.sha }})'
cat >pr_body.txt <<EOF
# Merge upstream
## Upstream details
Expand Down Expand Up @@ -197,17 +197,17 @@ runs:
shell: bash
id: merge-upstream
run: |
if [[ "${{ steps.check-if-merge-needed.outputs.merge }}" != "yes" ]]; then
echo "There is nothing to do."
if [[ '${{ steps.check-if-merge-needed.outputs.merge }}' != 'yes' ]]; then
echo 'There is nothing to do.'
exit 0
fi
cd target
git checkout "${{ inputs.target-branch }}"
git checkout '${{ inputs.target-branch }}'
set +e
merge_failed=0
git merge upstream/${{ inputs.upstream-branch }}
git merge 'upstream/${{ inputs.upstream-branch }}'
if [[ $? != 0 ]]; then
merge_failed=1
fi
Expand All @@ -218,17 +218,17 @@ runs:
shell: bash
if: ${{ inputs.slack-webhook-url != '' }}
run: |
if [[ "${{ steps.check-if-merge-needed.outputs.merge }}" != "yes" ]]; then
echo "There is nothing to do."
if [[ '${{ steps.check-if-merge-needed.outputs.merge }}' != 'yes' ]]; then
echo 'There is nothing to do.'
exit 0
fi
run_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
target="${{ inputs.target-repo }}/${{ inputs.target-branch }}"
upstream="${{ inputs.upstream-repo-url }}@${{ inputs.upstream-branch }}"
pull_request_number="${{ steps.create-pull-request.outputs.pull-request-number }}"
pull_request_url="${{ steps.create-pull-request.outputs.pull-request-url }}"
if [[ "${{ steps.merge-upstream.outputs.merge-failed }}" == "1" ]]; then
run_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
target='${{ inputs.target-repo }}/${{ inputs.target-branch }}'
upstream='${{ inputs.upstream-repo-url }}@${{ inputs.upstream-branch }}'
pull_request_number='${{ steps.create-pull-request.outputs.pull-request-number }}'
pull_request_url='${{ steps.create-pull-request.outputs.pull-request-url }}'
if [[ '${{ steps.merge-upstream.outputs.merge-failed }}' == '1' ]]; then
cat ${{ github.action_path }}/slack-msg-failure.json > tmp-slack-msg.json
else
cat ${{ github.action_path }}/slack-msg-success.json > tmp-slack-msg.json
Expand All @@ -239,4 +239,4 @@ runs:
sed -i "s|__PULL_REQUEST_NUMBER__|${pull_request_number}|g" tmp-slack-msg.json
sed -i "s|__PULL_REQUEST_URL__|${pull_request_url}|g" tmp-slack-msg.json
curl -X POST -d @tmp-slack-msg.json "${{ inputs.slack-webhook-url }}"
curl -X POST -d @tmp-slack-msg.json '${{ inputs.slack-webhook-url }}'
4 changes: 2 additions & 2 deletions yaml-validate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ runs:
cat .github/workflows/_check-vars-and-secrets.yml | \
grep -o "secrets\.[A-Z0-9_]\+" | sed 's|secrets.||g' > tmp-secrets-list.txt
docker pull ${DOCKER_IMAGE}
docker pull '${{ env.DOCKER_IMAGE }}'
docker run --rm --name tmp-ghv -v $(pwd)/.github:/dot-github \
-v $(pwd)/tmp-vars-list.txt:/tmp-vars-list.txt \
-v $(pwd)/tmp-secrets-list.txt:/tmp-secrets-list.txt \
${DOCKER_IMAGE} \
'${{ env.DOCKER_IMAGE }}' \
validate -p /dot-github \
-z /tmp-vars-list.txt \
-s /tmp-secrets-list.txt > validation_result
Expand Down

0 comments on commit 37f1782

Please sign in to comment.