Skip to content

Commit 21b243b

Browse files
committed
workflows: zizmor audit
1 parent 3ba39b2 commit 21b243b

9 files changed

+116
-81
lines changed

.github/workflows/ci-alpine-build.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
jobs:
2525
build-alpine:
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-24.04
2727
strategy:
2828
fail-fast: false
2929
matrix:
@@ -48,6 +48,8 @@ jobs:
4848
steps:
4949
- name: Checkout ${{ inputs.distinct_id }}
5050
uses: actions/checkout@v4
51+
with:
52+
persist-credentials: false
5153

5254
- name: Host - phased updates ${{ inputs.distinct_id }}
5355
run: printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
@@ -62,24 +64,28 @@ jobs:
6264
run: sudo apt install libpipeline1 qemu-user-static binfmt-support
6365

6466
- name: Host - Create Docker template env file ${{ inputs.distinct_id }}
67+
env:
68+
set_skip_icu: ${{ inputs.icu }}
69+
set_workflow_files: ${{ inputs.workflow-files }}
70+
set_build_debug: ${{ inputs.debug }}
6571
run: |
6672
printf '%s\n' "qbt_build_dir=${{ env.qbt_build_dir }}" > env.custom
6773
printf '%s\n' "qbt_libtorrent_version=${{ matrix.qbt_libtorrent_version }}" >> env.custom
6874
printf '%s\n' "qbt_qt_version=${{ matrix.qbt_qt_version }}" >> env.custom
6975
printf '%s\n' "qbt_build_tool=${{ matrix.qbt_build_tool }}" >> env.custom
7076
printf '%s\n' "qbt_cross_name=${{ matrix.qbt_cross_name }}" >> env.custom
7177
printf '%s\n' "qbt_patches_url=${{ github.repository }}" >> env.custom
72-
printf '%s\n' "qbt_skip_icu=${{ inputs.icu }}" >> env.custom
78+
printf '%s\n' "qbt_skip_icu=${set_skip_icu}" >> env.custom
7379
printf '%s\n' "qbt_boost_tag=" >> env.custom
7480
printf '%s\n' "qbt_libtorrent_tag=" >> env.custom
7581
printf '%s\n' "qbt_qt_tag=" >> env.custom
7682
printf '%s\n' "qbt_qbittorrent_tag=" >> env.custom
7783
printf '%s\n' "qbt_libtorrent_master_jamfile=" >> env.custom
78-
printf '%s\n' "qbt_workflow_files=${{ inputs.workflow-files }}" >> env.custom
84+
printf '%s\n' "qbt_workflow_files=${set_workflow_files}" >> env.custom
7985
printf '%s\n' "qbt_workflow_artifacts=" >> env.custom
8086
printf '%s\n' "qbt_cache_dir=" >> env.custom
81-
printf '%s\n' "qbt_optimise_strip=${{ inputs.debug }}" >> env.custom
82-
printf '%s\n' "qbt_build_debug=${{ inputs.debug }}" >> env.custom
87+
printf '%s\n' "qbt_optimise_strip=" >> env.custom
88+
printf '%s\n' "qbt_build_debug=${set_build_debug}" >> env.custom
8389
printf '%s\n' "qbt_revision_url=${{ github.repository }}" >> env.custom
8490
printf '%s\n' "qbt_standard=" >> env.custom
8591
printf '%s\n' "qbt_static_ish=" >> env.custom
@@ -98,8 +104,9 @@ jobs:
98104

99105
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
100106
run: |
101-
if [[ -f "${{ env.qbt_build_dir }}/release_info/disable-qt5" ]]; then
107+
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" ]]; then
102108
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
109+
printf '%s\n' "Found file: \`disable-qt5\`: settings \`disable_qt5=yes\` to yes" >> $GITHUB_STEP_SUMMARY
103110
fi
104111
105112
# - name: Docker - Copy repo patches to build folder ${{ inputs.distinct_id }}

.github/workflows/ci-alpine-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
release:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -30,6 +30,8 @@ jobs:
3030
steps:
3131
- name: Checkout ${{ inputs.distinct_id }}
3232
uses: actions/checkout@v4
33+
with:
34+
persist-credentials: false
3335

3436
- name: Pandoc - Bootstrap
3537
run: |
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: ci auto rerun failed jobs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
run_id:
7+
description: "The run id of the workflow to rerun"
8+
required: true
9+
attempts:
10+
description: "The number of attempts to rerun the workflow"
11+
required: true
12+
retries:
13+
description: "The number of retries to rerun the workflow"
14+
required: true
15+
github_repo:
16+
description: "The repository to rerun the workflow"
17+
required: false
18+
distinct_id:
19+
description: "The distinct id of the workflow to rerun"
20+
required: false
21+
22+
run-name: ci auto rerun failed jobs - attempt ${{ inputs.attempts }}
23+
24+
jobs:
25+
gh-cli-rerun:
26+
name: rerun - attempt ${{ inputs.attempts }}
27+
permissions:
28+
actions: write
29+
runs-on: ubuntu-latest
30+
env:
31+
GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}"
32+
steps:
33+
- name: Host - Checkout action ${{ inputs.distinct_id }}
34+
uses: actions/checkout@v4
35+
with:
36+
persist-credentials: false
37+
38+
- uses: userdocs/gh-cli-workflow-reruns/actions/auto-rerun-failed@main
39+
with:
40+
run_id: ${{ inputs.run_id }}
41+
attempts: ${{ inputs.attempts }}
42+
retries: ${{ inputs.retries }}
43+
github_repo: ${{ inputs.github_repo || github.repository }}
44+
distinct_id: ${{ inputs.distinct_id || github.run_id }}

.github/workflows/ci-auto-rerun-failed-jobs.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/ci-debian-build.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ on:
2222

2323
jobs:
2424
build:
25-
runs-on: ubuntu-latest
25+
defaults:
26+
run:
27+
shell: bash
28+
runs-on: ubuntu-24.04
2629
strategy:
2730
fail-fast: false
2831
matrix:
@@ -82,14 +85,20 @@ jobs:
8285
steps:
8386
- name: Checkout ${{ inputs.distinct_id }}
8487
uses: actions/checkout@v4
88+
with:
89+
persist-credentials: false
8590

8691
- name: Bootstrap all ${{ inputs.distinct_id }}
8792
run: bash qbittorrent-nox-static.sh -bs-a
8893

8994
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
9095
run: |
91-
if [[ -f "${{ env.qbt_build_dir }}/release_info/disable-qt5" ]]; then
96+
97+
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
98+
run: |
99+
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" ]]; then
92100
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
101+
printf '%s\n' "Found file: \`disable-qt5\` -> setting env: \`disable_qt5=yes\`" >> $GITHUB_STEP_SUMMARY
93102
fi
94103
95104
- name: glibc ${{ inputs.distinct_id }}
@@ -136,7 +145,7 @@ jobs:
136145
if: env.disable_qt5 != 'yes'
137146
run: bash qbittorrent-nox-static.sh qbittorrent
138147

139-
- name: Archive code coverage results ${{ inputs.distinct_id }}
148+
- name: Upload ${{ env.artifact_name }} artifacts ${{ inputs.distinct_id }}
140149
if: env.disable_qt5 != 'yes'
141150
uses: actions/upload-artifact@v4
142151
with:

.github/workflows/ci-main-reusable-caller.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,22 @@ jobs:
104104
cancel-in-progress: true
105105
permissions:
106106
actions: write
107-
runs-on: ubuntu-latest
107+
runs-on: ubuntu-24.04
108108
env:
109109
GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}"
110110
github_repo: "" # To use ci-auto-rerun-failed-jobs.yml hosted in a remote repository else default to the current repository. Requires PAT token AUTO_RERUN
111+
retries: ${{ github.event.inputs.retries || '1' }}
112+
distinct_id: ${{ github.event.inputs.distinct_id }}
111113
steps:
112114
- uses: actions/checkout@v4
115+
with:
116+
persist-credentials: false
113117
- name: ci-auto-rerun-failed-jobs via ${{ env.github_repo || github.repository }}
114118
run: >
115-
gh workflow run ci-auto-rerun-failed-jobs.yml
116-
--repo "${{ env.github_repo || github.repository }}"
117-
-f github_repo=${{ github.repository }}
118-
-f run_id=${{ github.run_id }}
119-
-f attempts=${{ github.run_attempt }}
120-
-f retries=${{ github.event.inputs.retries || '1' }}
121-
-f distinct_id=${{ github.event.inputs.distinct_id }}
119+
gh workflow run ci-auto-rerun-failed-jobs-action.yml
120+
--repo "${github_repo:-$GITHUB_REPOSITORY}"
121+
-f github_repo=${GITHUB_REPOSITORY}
122+
-f run_id=${GITHUB_RUN_ID}
123+
-f attempts=${GITHUB_RUN_ATTEMPT}
124+
-f retries=${retries}
125+
-f distinct_id=${distinct_id}

.github/workflows/sh_checker.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ concurrency:
99

1010
jobs:
1111
sh-checker:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
1518
- name: Run the sh-checker
1619
uses: luizm/[email protected]
1720
env:

.github/workflows/zizmor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: zizmor workflow audits
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
zizmor-workflow-audits:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
19+
- name: zizmor workflow audits
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
run: |
23+
pip install zizmor
24+
25+
printf '%b\n' "\`\`\`" >> $GITHUB_STEP_SUMMARY
26+
zizmor . --gh-token $GITHUB_TOKEN >> $GITHUB_STEP_SUMMARY
27+
printf '%b' "\`\`\`" >> $GITHUB_STEP_SUMMARY

qbittorrent-nox-static.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ while (("${#}")); do
21452145
printf '\n%b\n\n' " ${color_cyan}${qbt_install_dir_short}/patches/qbittorrent/${app_version[qbittorrent]}/patch${color_end}"
21462146
exit
21472147
;;
2148-
-h-bs-c | --help-boot-cmake)
2148+
-h-bs-c | --help-boot-strap-cmake)
21492149
printf '\n%b\n' " ${unicode_cyan_light_circle} ${text_bold}${text_underlined}Here is the help description for this flag:${color_end}"
21502150
printf '\n%b\n' " This bootstrap will install cmake and ninja build to the build directory"
21512151
printf '\n%b\n\n'"${color_green_light} Usage:${color_end} ${color_cyan_light}${qbt_working_dir_short}/$(basename -- "$0")${color_end} ${color_blue_light}-bs-c${color_end}"

0 commit comments

Comments
 (0)