test #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: [ubuntu-24.04, macos-15] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Dump /etc/hosts | |
| run: cat /etc/hosts | |
| - name: Checks | |
| 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) |