Skip to content

Commit bab98a4

Browse files
FlamefireFlow86
authored andcommitted
Update GitHub Actions configs
- Pin used actions - Add explicit permissions - Update actions where required & possible for Node 20 deprecation
1 parent 2488de2 commit bab98a4

3 files changed

Lines changed: 28 additions & 37 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright (C) 2005 - 2025 Settlers Freaks <sf-team at siedler25.org>
1+
# Copyright (C) 2005 - 2026 Settlers Freaks <sf-team at siedler25.org>
22
#
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

55
name: Create Release
6+
permissions:
7+
contents: write
68

79
on:
810
push:
@@ -18,7 +20,7 @@ jobs:
1820
name: Create Release
1921
runs-on: ubuntu-latest
2022
steps:
21-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2224
- name: Extract tag name
2325
id: get_tag
2426
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
@@ -60,34 +62,19 @@ jobs:
6062
fi
6163
- name: Create Release
6264
id: create_release
63-
uses: actions/create-release@v1
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
6666
with:
67+
token: ${{ secrets.GITHUB_TOKEN }}
6768
tag_name: ${{ github.ref }}
68-
release_name: Release ${{ github.ref }}
69+
name: Release ${{ github.ref }}
6970
body: |
7071
Return To The Roots (Settlers II(R) Clone)
7172
${{ env.TAG_MSG }}
7273
- ${{steps.filenames.outputs.src}} contains all source files including the submodules
7374
- ${{steps.filenames.outputs.devTools}} contains optional binaries for development. Extract over the source folder if required
7475
draft: false
7576
prerelease: false
76-
- name: Upload source distribution
77-
uses: actions/upload-release-asset@v1
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
with:
81-
upload_url: ${{ steps.create_release.outputs.upload_url }}
82-
asset_path: ./${{steps.filenames.outputs.src}}
83-
asset_name: ${{steps.filenames.outputs.src}}
84-
asset_content_type: application/tar.gz
85-
- name: Upload Dev Tools
86-
uses: actions/upload-release-asset@v1
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
with:
90-
upload_url: ${{ steps.create_release.outputs.upload_url }}
91-
asset_path: ./${{steps.filenames.outputs.devTools}}
92-
asset_name: ${{steps.filenames.outputs.devTools}}
93-
asset_content_type: application/tar.gz
77+
files: |
78+
${{steps.filenames.outputs.src}}
79+
${{steps.filenames.outputs.devTools}}
80+
fail_on_unmatched_files: true

.github/workflows/static-analysis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright (C) 2005 - 2025 Settlers Freaks <sf-team at siedler25.org>
1+
# Copyright (C) 2005 - 2026 Settlers Freaks <sf-team at siedler25.org>
22
#
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

55
name: Static analysis
6+
permissions:
7+
contents: write
68

79
on:
810
push:
@@ -16,12 +18,12 @@ jobs:
1618
StyleAndFormatting:
1719
runs-on: ubuntu-latest
1820
steps:
19-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2022
- run: git submodule update --init
2123
- name: Validation
2224
run: tools/ci/staticValidation.sh "$GITHUB_WORKSPACE"
2325
- name: Formatting
24-
uses: DoozyX/clang-format-lint-action@v0.18.2
26+
uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31 # v0.18.2
2527
with:
2628
source: "extras libs tests external/libendian external/liblobby external/libsiedler2 external/libutil external/mygettext external/s25edit external/s25update"
2729
clangFormatVersion: 10
@@ -32,7 +34,7 @@ jobs:
3234
-prune -false -o \( -name '*.hpp' -or -name '*.h' \) \
3335
-print0 | xargs -0 -n1 tools/ci/checkIncludeGuards.sh
3436
- name: Lint markdown files
35-
uses: avto-dev/markdown-lint@v1
37+
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
3638
with:
3739
ignore: external data/RTTR/MAPS .
3840
- name: Check licensing
@@ -47,7 +49,7 @@ jobs:
4749
ADDITIONAL_CMAKE_FLAGS: ""
4850
runs-on: ubuntu-24.04
4951
steps:
50-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5153
- run: git submodule update --init
5254
- name: Install dependencies
5355
run: |

.github/workflows/unit-tests.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright (C) 2005 - 2025 Settlers Freaks <sf-team at siedler25.org>
1+
# Copyright (C) 2005 - 2026 Settlers Freaks <sf-team at siedler25.org>
22
#
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

55
name: Unit tests
6+
permissions:
7+
contents: write
68

79
on:
810
push:
@@ -37,11 +39,11 @@ jobs:
3739
- { os: windows-2022, generator: Visual Studio 17 2022, type: Release, platform: x64}
3840
runs-on: ${{matrix.os}}
3941
steps:
40-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4143
with:
4244
submodules: true
4345
- name: Install boost
44-
uses: MarkusJx/install-boost@6d8df42f57de83c5b326b5b83e7b35d650030103
46+
uses: MarkusJx/install-boost@8ba8b2fac59ef3d91a838bb4aa53ceabd33d1aa3 # v2.5.1
4547
id: install-boost
4648
with:
4749
boost_version: ${{env.BOOST_VERSION}}
@@ -139,18 +141,18 @@ jobs:
139141
echo "GCOV=$GCOV" >> $GITHUB_ENV
140142
141143
# Coverage collection requires access to history to find merge-base
142-
- uses: actions/checkout@v4
144+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
143145
if: "!matrix.coverage"
144146
with:
145147
submodules: true
146-
- uses: actions/checkout@v4
148+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
147149
if: matrix.coverage
148150
with:
149151
submodules: true
150152
fetch-depth: 0 # Full history
151153

152154
- name: Cache dependencies
153-
uses: actions/cache@v4
155+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
154156
with:
155157
path: ${{env.DEPS_DIR}}
156158
key: ${{matrix.os}}-${{env.BOOST_VERSION}}
@@ -182,7 +184,7 @@ jobs:
182184
fi
183185
184186
- name: Setup CCache
185-
uses: hendrikmuhs/ccache-action@v1
187+
uses: hendrikmuhs/ccache-action@33522472633dbd32578e909b315f5ee43ba878ce # v1.2.22
186188
with:
187189
key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.type}}-${{matrix.boost}}
188190
max-size: 200M
@@ -218,7 +220,7 @@ jobs:
218220

219221
- name: Upload coverage (Coveralls)
220222
if: matrix.coverage && success()
221-
uses: coverallsapp/github-action@master
223+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
222224
with:
223225
github-token: ${{secrets.GITHUB_TOKEN}}
224226
path-to-lcov: srccov.info

0 commit comments

Comments
 (0)