Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action: bind mount /usr/bin/gh into the containers #1162

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
GitHub Action: bind mount /usr/bin/gh into the containers
We use the `gh` GitHub command line tool to create pull requests.
The tool is installed inside the Tumbleweed container using `zypper`
as usually.

The problem is that the installation might fail in some cases
(GPG key problem, network error,...) and this fails whole action.

But we actually do not need to install the tool, it already is pre-installed in
the default Ubuntu host system. And because the `gh` tool is a statically
linked binary without any dependencies we can simply just bind mount it from
the host inside the container without any installation.
lslezak committed Apr 23, 2024

Verified

This commit was signed with the committer’s verified signature.
lslezak Ladislav Slezák
commit f04d0e4ead3771502e7edbf2e5180b697e4f4c4a
10 changes: 6 additions & 4 deletions .github/workflows/weblate-merge-po.yml
Original file line number Diff line number Diff line change
@@ -22,18 +22,20 @@ jobs:

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

steps:
- name: Configure and refresh repositories
run: |
# install the GitHub command line tool "gh"
zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
# disable unused repositories to have a faster refresh
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
zypper --non-interactive --gpg-auto-import-keys ref
zypper --non-interactive ref

- name: Install tools
run: zypper --non-interactive install --no-recommends gh git gettext-tools python3-langtable
run: zypper --non-interactive install --no-recommends git gettext-tools python3-langtable

- name: Configure Git
run: |
10 changes: 6 additions & 4 deletions .github/workflows/weblate-merge-products-po.yml
Original file line number Diff line number Diff line change
@@ -22,18 +22,20 @@ jobs:

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

steps:
- name: Configure and refresh repositories
run: |
# install the GitHub command line tool "gh"
zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
# disable unused repositories to have a faster refresh
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
zypper --non-interactive --gpg-auto-import-keys ref
zypper --non-interactive ref

- name: Install tools
run: zypper --non-interactive install --no-recommends gh git gettext-tools npm-default
run: zypper --non-interactive install --no-recommends git gettext-tools npm-default

- name: Configure Git
run: |
4 changes: 2 additions & 2 deletions .github/workflows/weblate-merge-service-po.yml
Original file line number Diff line number Diff line change
@@ -24,15 +24,15 @@ jobs:
image: registry.opensuse.org/opensuse/tumbleweed:latest
volumes:
# bind mount the GitHub CLI tool from the Ubuntu host,
# it is a statically linked binary so it should work everywhere
# it is a statically linked binary so it should work also in TumbleWeed
- /usr/bin/gh:/usr/bin/gh

steps:
- name: Configure and refresh repositories
run: |
# disable unused repositories to have a faster refresh
zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \
zypper --non-interactive --gpg-auto-import-keys ref
zypper --non-interactive ref

- name: Install tools
run: zypper --non-interactive install --no-recommends git gettext-tools