Skip to content

test

test #27

Workflow file for this run

name: Check Hostname
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
check-hostname:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-26]
steps:
- uses: actions/checkout@v3
- name: Dump /etc/hosts
run: cat /etc/hosts
- name: scutil
run: |
set -x
scutil --get ComputerName # the ”friendly” name
scutil --get LocalHostName # the Bonjour / mDNS / ZeroConf host name
scutil --get HostName # should be the same as what hostname command returns
- name: Run hostname check script
run: |
set -x
echo "Hostname: $(hostname)"
echo "Fully Qualified Domain Name: $(hostname -f)"
echo "Pinging localhost..."
ping -c 1 localhost
echo "Pinging hostname..."
ping -c 1 $(hostname)
echo "Pinging FQDN..."
ping -c 1 $(hostname -f)
# - name: Change hostname
# run: |
# # https://apple.stackexchange.com/questions/287760/set-the-hostname-computer-name-for-macos
# sudo scutil --set HostName <new host name>
# sudo scutil --set LocalHostName <new host name>
# sudo scutil --set ComputerName <new name>
# dscacheutil -flushcache