File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ permissions:
2626 contents : read
2727
2828jobs :
29- find -runners :
29+ filter -runners :
3030 runs-on : ubuntu-latest
3131 outputs :
3232 runners : ${{ steps.get-runners.outputs.runners }}
7070
7171 echo "✅ Selected runners with formatted labels:"
7272 echo "$filtered_runners"
73+ update-hosts :
74+ needs : filter-runners
75+ runs-on :
76+ group : fractal
77+ labels : ${{ matrix.labels }}
78+ strategy :
79+ matrix : ${{ fromJson(needs.filter-runners.outputs.matrix) }}
80+ steps :
81+ - name : Print Runner Info
82+ run : |
83+ echo "🔄 Running on group: ${{ matrix.group }}"
84+ echo "🔄 Labels: ${{ matrix.labels }}"
85+
86+ - name : Get IP and Hostname
87+ run : |
88+ echo "🔄 Getting IP and hostname for the runner..."
89+
90+ # 假设通过某种方式获取 IP 和主机名
91+ ip="192.168.1.100" # 替换为实际获取 IP 的逻辑
92+ hostname="runner.example.com" # 替换为实际获取主机名的逻辑
93+
94+ echo "IP: $ip"
95+ echo "Hostname: $hostname"
96+
97+ # 将 IP 和主机名写入 /etc/hosts
98+ echo "$ip $hostname" | sudo tee -a /etc/hosts
7399
100+ echo "✅ Updated /etc/hosts with runner IP and hostname:"
101+ cat /etc/hosts
74102 # response_file=$(mktemp)
75103
76104 # if ! gh api "/orgs/${{ github.repository_owner }}/actions/runners" \
You can’t perform that action at this time.
0 commit comments