diff --git a/check-image-existence-ecr/action.yml b/check-image-existence-ecr/action.yml index d8cb54f..bd9d196 100644 --- a/check-image-existence-ecr/action.yml +++ b/check-image-existence-ecr/action.yml @@ -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 diff --git a/create-featurenet/action.yml b/create-featurenet/action.yml index f40532b..ed53371 100644 --- a/create-featurenet/action.yml +++ b/create-featurenet/action.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -273,11 +273,11 @@ 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' @@ -285,5 +285,5 @@ runs: 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 }}' diff --git a/delete-featurenet/action.yml b/delete-featurenet/action.yml index 6bf9b8c..4cac44f 100644 --- a/delete-featurenet/action.yml +++ b/delete-featurenet/action.yml @@ -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 @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/install-rust-toolchain/action.yml b/install-rust-toolchain/action.yml index d3f580e..1c04dbb 100644 --- a/install-rust-toolchain/action.yml +++ b/install-rust-toolchain/action.yml @@ -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 @@ -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 }} diff --git a/test-upstream-merge/action.yml b/test-upstream-merge/action.yml index 893269f..c33223c 100644 --- a/test-upstream-merge/action.yml +++ b/test-upstream-merge/action.yml @@ -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 @@ -85,9 +85,9 @@ 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 @@ -95,23 +95,23 @@ runs: - 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 @@ -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 @@ -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 < tmp-slack-msg.json else cat ${{ github.action_path }}/slack-msg-success.json > tmp-slack-msg.json @@ -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 }}' diff --git a/yaml-validate/action.yml b/yaml-validate/action.yml index 4e6f2ec..439eb67 100644 --- a/yaml-validate/action.yml +++ b/yaml-validate/action.yml @@ -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