Skip to content

Commit 988ad65

Browse files
authoredApr 23, 2024··
GitHub Action: bind mount /usr/bin/gh into the containers (#1162)
## Problem - GitHub action which merges the translations from Weblate failed ([Action log](https://github.com/openSUSE/agama/actions/runs/8769617276/job/24065296950#step:3:27)) - The problem is that the repository changed the GPG signature and the `gh` package cannot be installed ## Solution - Do not install it, it already is pre-installed in the default Ubuntu host system - The `gh` tool is a statically linked binary without any dependencies so we can simply just bind mount it from the host into the container - We already use this solution in the `.github/workflows/weblate-merge-service-po.yml` file, let's use it everywhere
2 parents d4f44b8 + f04d0e4 commit 988ad65

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed
 

‎.github/workflows/weblate-merge-po.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ jobs:
2222

2323
container:
2424
image: registry.opensuse.org/opensuse/tumbleweed:latest
25+
volumes:
26+
# bind mount the GitHub CLI tool from the Ubuntu host,
27+
# it is a statically linked binary so it should work also in TumbleWeed
28+
- /usr/bin/gh:/usr/bin/gh
2529

2630
steps:
2731
- name: Configure and refresh repositories
2832
run: |
29-
# install the GitHub command line tool "gh"
30-
zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
3133
# disable unused repositories to have a faster refresh
3234
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
33-
zypper --non-interactive --gpg-auto-import-keys ref
35+
zypper --non-interactive ref
3436
3537
- name: Install tools
36-
run: zypper --non-interactive install --no-recommends gh git gettext-tools python3-langtable
38+
run: zypper --non-interactive install --no-recommends git gettext-tools python3-langtable
3739

3840
- name: Configure Git
3941
run: |

‎.github/workflows/weblate-merge-products-po.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ jobs:
2222

2323
container:
2424
image: registry.opensuse.org/opensuse/tumbleweed:latest
25+
volumes:
26+
# bind mount the GitHub CLI tool from the Ubuntu host,
27+
# it is a statically linked binary so it should work also in TumbleWeed
28+
- /usr/bin/gh:/usr/bin/gh
2529

2630
steps:
2731
- name: Configure and refresh repositories
2832
run: |
29-
# install the GitHub command line tool "gh"
30-
zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
3133
# disable unused repositories to have a faster refresh
3234
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
33-
zypper --non-interactive --gpg-auto-import-keys ref
35+
zypper --non-interactive ref
3436
3537
- name: Install tools
36-
run: zypper --non-interactive install --no-recommends gh git gettext-tools npm-default
38+
run: zypper --non-interactive install --no-recommends git gettext-tools npm-default
3739

3840
- name: Configure Git
3941
run: |

‎.github/workflows/weblate-merge-service-po.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424
image: registry.opensuse.org/opensuse/tumbleweed:latest
2525
volumes:
2626
# bind mount the GitHub CLI tool from the Ubuntu host,
27-
# it is a statically linked binary so it should work everywhere
27+
# it is a statically linked binary so it should work also in TumbleWeed
2828
- /usr/bin/gh:/usr/bin/gh
2929

3030
steps:
3131
- name: Configure and refresh repositories
3232
run: |
3333
# disable unused repositories to have a faster refresh
3434
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
35-
zypper --non-interactive --gpg-auto-import-keys ref
35+
zypper --non-interactive ref
3636
3737
- name: Install tools
3838
run: zypper --non-interactive install --no-recommends git gettext-tools

0 commit comments

Comments
 (0)
Please sign in to comment.