Skip to content

Commit 47825ff

Browse files
authored
Merge pull request #325 from boostorg/security-hardening
2 parents bf783b0 + 0f4405e commit 47825ff

21 files changed

Lines changed: 119 additions & 92 deletions

.azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# Copyright 2015-2019 Rene Rivera.
33
# Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
4-
# Copyright 2020-2024 Alexander Grund
4+
# Copyright 2020-2026 Alexander Grund
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
77

@@ -137,7 +137,7 @@ stages:
137137
- bash: |
138138
set -ex
139139
140-
for i in {1..$NET_RETRY_COUNT}; do
140+
for ((i=1; i <= NET_RETRY_COUNT; i++)); do
141141
git clone --depth 1 --branch master https://github.com/boostorg/boost-ci.git boost-ci-cloned && break || sleep 10
142142
done
143143
# Copy ci folder if not testing Boost.CI

.drone/drone.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export CC=${CC:-gcc}
1111
export PATH=~/.local/bin:/usr/local/bin:$PATH
1212

1313
git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
14-
[ "$(basename $DRONE_REPO)" == "boost-ci" ] || cp -prf boost-ci-cloned/ci .
14+
[[ "$(basename "$DRONE_REPO")" == "boost-ci" ]] || cp -prf boost-ci-cloned/ci .
1515
rm -rf boost-ci-cloned
1616

1717
export BOOST_CI_TARGET_BRANCH="$DRONE_BRANCH"
@@ -33,6 +33,7 @@ if [[ $(uname) == "Linux" ]]; then
3333
error=1
3434
fi
3535
if ((error == 1)); then
36+
# shellcheck disable=SC2016
3637
[[ "${DRONE_EXTRA_PRIVILEGED:-0}" == "True" ]] || echo 'Try passing `privileged=True` to the job in .drone.star'
3738
echo -e "\n"
3839
fi
@@ -46,6 +47,7 @@ scripts=(
4647
for script in "${scripts[@]}"; do
4748
if [ -e "$script" ]; then
4849
echo "==============================> RUN $script"
50+
# shellcheck disable=SC1090
4951
source "$script"
5052
set +x
5153
fi
@@ -56,26 +58,28 @@ echo "==================================> SCRIPT ($DRONE_JOB_BUILDTYPE)"
5658

5759
case "$DRONE_JOB_BUILDTYPE" in
5860
boost)
59-
$BOOST_CI_SRC_FOLDER/ci/build.sh
61+
"$BOOST_CI_SRC_FOLDER/ci/build.sh"
6062
;;
6163
codecov)
62-
$BOOST_CI_SRC_FOLDER/ci/travis/codecov.sh
64+
"$BOOST_CI_SRC_FOLDER/ci/travis/codecov.sh"
6365
;;
6466
valgrind)
65-
$BOOST_CI_SRC_FOLDER/ci/travis/valgrind.sh
67+
"$BOOST_CI_SRC_FOLDER/ci/travis/valgrind.sh"
6668
;;
6769
coverity)
6870
echo "DRONE_BRANCH=$DRONE_BRANCH, DRONE_BUILD_EVENT=$DRONE_BUILD_EVENT, DRONE_REPO=$DRONE_REPO"
6971
if [[ "$DRONE_BRANCH" =~ ^(master|develop)$ ]] && [[ "$DRONE_BUILD_EVENT" =~ ^(push|cron)$ ]]; then
7072
if [ -z "$COVERITY_SCAN_NOTIFICATION_EMAIL" ] || [ -z "$COVERITY_SCAN_TOKEN" ]; then
7173
echo "Coverity details not set up"
74+
# shellcheck disable=SC2016
7275
[ -n "$COVERITY_SCAN_NOTIFICATION_EMAIL" ] || echo 'Missing $COVERITY_SCAN_NOTIFICATION_EMAIL'
76+
# shellcheck disable=SC2016
7377
[ -n "$COVERITY_SCAN_TOKEN" ] || echo 'Missing $COVERITY_SCAN_TOKEN'
7478
exit 1
7579
fi
7680
export BOOST_REPO="$DRONE_REPO"
7781
export BOOST_BRANCH="$DRONE_BRANCH"
78-
$BOOST_CI_SRC_FOLDER/ci/coverity.sh
82+
"$BOOST_CI_SRC_FOLDER/ci/coverity.sh"
7983
fi
8084
;;
8185
*)

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Copyright 2020-2021 Peter Dimov
33
# Copyright 2021 Andrey Semashev
4-
# Copyright 2021-2024 Alexander Grund
4+
# Copyright 2021-2026 Alexander Grund
55
# Copyright 2022-2025 James E. King III
66
#
77
# Distributed under the Boost Software License, Version 1.0.
@@ -16,6 +16,9 @@
1616
---
1717
name: Boost.CI
1818

19+
permissions:
20+
contents: read
21+
1922
on:
2023
pull_request:
2124
push:

.github/workflows/ci_test_no_jobs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Copyright 2020-2021 Peter Dimov
33
# Copyright 2021 Andrey Semashev
4-
# Copyright 2021-2024 Alexander Grund
4+
# Copyright 2021-2026 Alexander Grund
55
# Copyright 2022-2025 James E. King III
66
#
77
# Distributed under the Boost Software License, Version 1.0.
@@ -14,6 +14,9 @@
1414
---
1515
name: Test.NoJobs.CI
1616

17+
permissions:
18+
contents: read
19+
1720
on:
1821
pull_request:
1922
push:

.github/workflows/ci_test_opposite.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Copyright 2020-2021 Peter Dimov
33
# Copyright 2021 Andrey Semashev
4-
# Copyright 2021-2024 Alexander Grund
4+
# Copyright 2021-2026 Alexander Grund
55
# Copyright 2022-2025 James E. King III
66
#
77
# Distributed under the Boost Software License, Version 1.0.
@@ -14,6 +14,9 @@
1414
---
1515
name: Test.Opposite.CI
1616

17+
permissions:
18+
contents: read
19+
1720
on:
1821
pull_request:
1922
push:
@@ -28,7 +31,7 @@ on:
2831
- LICENSE
2932
- meta/**
3033
- README.md
31-
34+
3235
jobs:
3336
call-neutered-boost-ci:
3437
name: Run Boost.CI

.github/workflows/code-coverage.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
name: Code Coverage
1717

18+
permissions:
19+
contents: write
20+
1821
on:
1922
push:
2023
branches:
@@ -61,7 +64,7 @@ jobs:
6164

6265
steps:
6366
- name: Checkout code
64-
uses: actions/checkout@v6
67+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6568

6669
- name: Check for code-coverage Branch
6770
run: |
@@ -80,30 +83,31 @@ jobs:
8083
fi
8184
8285
- name: Install Python
83-
uses: actions/setup-python@v6
86+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8487
with:
8588
python-version: '3.13'
8689

8790
- name: Install Python packages
8891
run: pip install gcovr
8992

9093
- name: Checkout ci-automation
91-
uses: actions/checkout@v6
94+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9295
with:
9396
repository: cppalliance/ci-automation
9497
path: ci-automation
9598

9699
- name: Build and run tests & collect coverage data
100+
env:
101+
B2_CXXSTD: ${{matrix.cxxstd}}
102+
ORGANIZATION: ${{github.repository_owner}}
97103
run: |
98104
set -xe
99105
ls -al
100-
export ORGANIZATION=${GITHUB_REPOSITORY_OWNER}
101-
export REPONAME=$(basename ${GITHUB_REPOSITORY})
102-
export B2_CXXSTD=${{matrix.cxxstd}}
106+
export REPONAME=$(basename "${GITHUB_REPOSITORY}")
103107
${{matrix.gcovr_script}}
104108
105109
- name: Checkout GitHub pages branch
106-
uses: actions/checkout@v6
110+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107111
with:
108112
ref: code-coverage
109113
path: gh_pages_dir

.github/workflows/old_ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Copyright 2020-2021 Peter Dimov
33
# Copyright 2021 Andrey Semashev
4-
# Copyright 2021-2024 Alexander Grund
4+
# Copyright 2021-2026 Alexander Grund
55
#
66
# Distributed under the Boost Software License, Version 1.0.
77
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -11,6 +11,9 @@
1111
---
1212
name: Compatible.Old.CI
1313

14+
permissions:
15+
contents: read
16+
1417
on:
1518
pull_request:
1619
push:
@@ -117,12 +120,12 @@ jobs:
117120
steps:
118121
- name: Setup environment
119122
run: |
120-
[ ! -f "/etc/debian_version" ] || echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
123+
[ ! -f "/etc/debian_version" ] || echo "DEBIAN_FRONTEND=noninteractive" >> "$GITHUB_ENV"
121124
git config --global pack.threads 0
122125
123-
- uses: actions/checkout@v4
126+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
124127
if: '!matrix.coverage'
125-
- uses: actions/checkout@v4
128+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
126129
if: 'matrix.coverage'
127130
with: { fetch-depth: 0 }
128131

0 commit comments

Comments
 (0)