mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Add action to fix /etc/hosts
This commit is contained in:
parent
b489cd628f
commit
977dfd62ac
2 changed files with 21 additions and 2 deletions
18
.github/actions/fix-etc-hosts/action.yml
vendored
Normal file
18
.github/actions/fix-etc-hosts/action.yml
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
name: Fix /etc/hosts
|
||||
description: |
|
||||
Workaround for
|
||||
"Reverse name lookup is broken for current hostname in ubuntu-latest VMs",
|
||||
reported as https://github.com/actions/virtual-environments/issues/3185
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: |
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
# Ensure that reverse lookups for current hostname are handled properly
|
||||
# Add the current IP address, long hostname and short hostname record to /etc/hosts file
|
||||
eth0_ip_addr=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
|
||||
hostname_fqdn=$(hostname -f)
|
||||
hostname_short=$(hostname -s)
|
||||
echo -e "${eth0_ip_addr}\t${hostname_fqdn} ${hostname_short}" | sudo tee -a /etc/hosts
|
||||
fi
|
||||
shell: bash
|
||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
|
@ -76,8 +76,9 @@ jobs:
|
|||
LIBMESH: ${{ matrix.libmesh }}
|
||||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: ./.github/actions/fix-etc-hosts
|
||||
|
||||
-
|
||||
name: Set up Python ${{ matrix.python-version }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue