Skip to content

Commit 801d9e0

Browse files
committed
Fix linter warnings
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent 4ee403b commit 801d9e0

File tree

3 files changed

+40
-29
lines changed

3 files changed

+40
-29
lines changed

.github/workflows/docker.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
name: Build and Push Docker Image to GHCR
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
pull_request:
48

5-
permissions:
6-
contents: read # Required to checkout the repo code
7-
packages: write # Required to push packages to GHCR
9+
permissions: {}
810

911
jobs:
1012
xcp-ng-build-env-82:
1113
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write # Required to push packages to GHCR
1216
steps:
1317
- uses: actions/checkout@v4
14-
- uses: docker/setup-buildx-action@v3
18+
with:
19+
persist-credentials: false
20+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
1521
with:
1622
driver: docker-container
17-
- uses: docker/login-action@v3
23+
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
1824
if: github.ref == 'refs/heads/master'
1925
with:
2026
registry: ghcr.io
2127
username: ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
2228
password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
2329
- run: echo "VERSION=$(cat ./src/xcp_ng_dev/files/protocol-version.txt | tr -d '\n')" >> $GITHUB_ENV
24-
- uses: docker/build-push-action@v5 # Using v5 for latest features
30+
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
2531
with:
2632
context: ./src/xcp_ng_dev/
2733
file: ./src/xcp_ng_dev/files/Dockerfile-8.x
@@ -36,19 +42,23 @@ jobs:
3642
3743
xcp-ng-build-env-83:
3844
runs-on: ubuntu-latest
45+
permissions:
46+
packages: write # Required to push packages to GHCR
3947
steps:
4048
- uses: actions/checkout@v4
41-
- uses: docker/setup-buildx-action@v3
49+
with:
50+
persist-credentials: false
51+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
4252
with:
4353
driver: docker-container
44-
- uses: docker/login-action@v3
54+
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
4555
if: github.ref == 'refs/heads/master'
4656
with:
4757
registry: ghcr.io
4858
username: ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
4959
password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
5060
- run: echo "VERSION=$(cat ./src/xcp_ng_dev/files/protocol-version.txt | tr -d '\n')" >> $GITHUB_ENV
51-
- uses: docker/build-push-action@v5 # Using v5 for latest features
61+
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
5262
with:
5363
context: ./src/xcp_ng_dev/
5464
file: ./src/xcp_ng_dev/files/Dockerfile-8.x
@@ -62,19 +72,23 @@ jobs:
6272
# TODO: uncomment once we have a public xcp-ng 9.0 repository
6373
# xcp-ng-build-env-90:
6474
# runs-on: ubuntu-latest
75+
# permissions:
76+
# packages: write # Required to push packages to GHCR
6577
# steps:
6678
# - uses: actions/checkout@v4
67-
# - uses: docker/setup-buildx-action@v3
79+
# with:
80+
# persist-credentials: false
81+
# - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
6882
# with:
6983
# driver: docker-container
70-
# - uses: docker/login-action@v3
84+
# - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
7185
# if: github.ref == 'refs/heads/master'
7286
# with:
7387
# registry: ghcr.io
7488
# username: ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
7589
# password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
7690
# - run: echo "VERSION=$(cat ./src/xcp_ng_dev/files/protocol-version.txt | tr -d '\n')" >> $GITHUB_ENV
77-
# - uses: docker/build-push-action@v5 # Using v5 for latest features
91+
# - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
7892
# with:
7993
# context: ./src/xcp_ng_dev/
8094
# file: ./src/xcp_ng_dev/files/Dockerfile-9.x

.github/workflows/main.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ on:
66
- 'master'
77
pull_request:
88

9+
permissions: {}
10+
911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@v2
14-
- name: Install uv
15-
uses: astral-sh/setup-uv@v6
16-
with:
17-
version: "0.7.x"
18-
- name: Install dependencies
19-
run: uv sync --frozen
20-
- name: Test
21-
# use script to provide a tty (workaround of systematic "docker -t"?)
22-
shell: 'script -q -e -c "bash {0}"'
23-
run: |
24-
uv run ./test/test.sh
15+
- uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
- uses: ./.github/actions/uv-setup/
19+
- name: Test
20+
# use script to provide a tty (workaround of systematic "docker -t"?)
21+
shell: 'script -q -e -c "bash {0}"'
22+
run: |
23+
./test/test.sh

src/xcp_ng_dev/cli.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
import argparse
1212
import os
13-
import subprocess
1413
import shutil
14+
import subprocess
1515
import sys
1616
from pathlib import Path
1717

@@ -35,9 +35,7 @@
3535
def is_podman(runner):
3636
if os.path.basename(runner) == "podman":
3737
return True
38-
if subprocess.getoutput(f"{runner} --version").startswith("podman "):
39-
return True
40-
return False
38+
return subprocess.getoutput(f"{runner} --version").startswith("podman ")
4139

4240
def read_version():
4341
with open(Path(__file__).parent / 'files/protocol-version.txt') as f:

0 commit comments

Comments
 (0)