File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # https://github.com/marketplace/actions/shellcheck
2+ name : Check shell scripts
3+
4+ on :
5+ workflow_dispatch :
6+ pull_request :
7+ types :
8+ - opened
9+ - edited
10+ - reopened
11+ - synchronize
12+
13+ permissions : {}
14+
15+ concurrency :
16+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+ cancel-in-progress : true
18+
19+ jobs :
20+ shellcheck :
21+ name : shellcheck
22+ runs-on : ubuntu-24.04
23+ steps :
24+ - name : Harden the runner (Audit all outbound calls)
25+ uses : step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
26+ with :
27+ egress-policy : audit
28+
29+ - name : Checkout the code
30+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+ with :
32+ fetch-depth : 0
33+ persist-credentials : false
34+
35+ - name : Run ShellCheck
36+ uses : ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
37+ with :
38+ ignore_paths : " **/vendor/**"
39+
Original file line number Diff line number Diff line change 1- rm -rf occlum_instance && mkdir occlum_instance && cd occlum_instance
1+ #! /bin/bash
2+ rm -rf occlum_instance && mkdir occlum_instance && cd occlum_instance || exit
23
34occlum init && rm -rf image
45
Original file line number Diff line number Diff line change @@ -31,39 +31,38 @@ dump_keys() {
3131
3232generate_keys () {
3333 repo=
34- if [ -z $1 ]; then
34+ if [ -z " $1 " ]; then
3535 repo=" default"
3636 else
37- repo=$1
37+ repo=" $1 "
3838 fi
3939
40- create_keys 10 $repo
40+ create_keys 10 " $repo "
4141 dump_keys
4242}
4343
4444export_key () {
45- local json_file=$1
46- local uri=$2
47- local output_path=$3
45+ local json_file=" $1 "
46+ local uri=" $2 "
47+ local output_path=" $3 "
4848
49- cat $json_file | jq " .\" $uri \" " -r | base64 -d > $output_path
49+ cat " $json_file " | jq " .\" $uri \" " -r | base64 -d > " $output_path "
5050}
5151
5252main () {
53- local dir=$( cd " $( dirname " $0 " ) " ; pwd)
54- local operation=$1
53+ local operation=" $1 "
5554 if [ -z " $operation " ]; then
5655 usage
5756 fi
5857
59- if [ " $operation " = " generate" ] ; then
60- generate_keys $2
58+ if [ " $operation " = " generate" ] ; then
59+ generate_keys " $2 "
6160 elif [ " $operation " = " export" ] ; then
62- if [ -z $4 ] ; then
61+ if [ -z " $4 " ] ; then
6362 echo " [FAILED] Unmatched parameters"
6463 usage
6564 fi
66- export_key $2 $3 $4
65+ export_key " $2 " " $3 " " $4 "
6766 else
6867 echo " [FAILED] Unknown operation $operation "
6968 usage
Original file line number Diff line number Diff line change @@ -12,12 +12,13 @@ set -o pipefail
1212[ -n " ${BASH_VERSION:- } " ] && set -o errtrace
1313[ -n " ${DEBUG:- } " ] && set -o xtrace
1414
15- source $HOME /.cargo/env
15+ # shellcheck disable=SC1091
16+ source " $HOME /.cargo/env"
1617
1718SCRIPT_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
1819CDH_DIR=$SCRIPT_DIR /../../confidential-data-hub
1920
20- pushd $CDH_DIR
21+ pushd " $CDH_DIR "
2122
2223make RESOURCE_PROVIDER=none KMS_PROVIDER=none RPC=" ${RPC} " LIBC=gnu
2324make DESTDIR=" ${SCRIPT_DIR} /${RPC} " install LIBC=gnu
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ set -o errtrace
1212
1313[ -n " ${DEBUG:- } " ] && set -o xtrace
1414
15- script_dir=$( dirname $( readlink -f $0 ) )
15+ script_dir=$( dirname " $( readlink -f " $0 " ) " )
1616test_resource_json_name=" ${2:- aa-offline_fs_kbc-resources.json} "
1717resource_json_name=" aa-offline_fs_kbc-resources.json"
1818keys_json_name=" aa-offline_fs_kbc-keys.json"
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ set -o errtrace
1212
1313[ -n " ${DEBUG:- } " ] && set -o xtrace
1414
15- script_dir=" $( dirname $( readlink -f $0 ) ) "
15+ script_dir=" $( dirname " $( readlink -f " $0 " ) " ) "
1616test_artifacts_dir=" ${script_dir} /../test_data/simple-signing-scheme"
1717rootfs_quay_verification_directory=" /etc/containers/quay_verification"
1818
You can’t perform that action at this time.
0 commit comments