Skip to content

Commit ed58450

Browse files
adjusted cat script and service file
1 parent a0166e8 commit ed58450

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

.github/scripts/ppc64le/self-hosted-builder/[email protected]

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ ExecStartPre=-/usr/local/bin/gh_token_generator.sh /etc/actions-runner/%i/appid.
1212
ExecStartPre=-/usr/local/bin/gh_cat_token.sh /etc/actions-runner/%i/ghtoken.env /etc/actions-runner/%i/ghtoken.socket
1313

1414
# Wait for token to be written to the pipe
15-
#ExecStartPre=/bin/bash -c 'while [ ! -s /etc/actions-runner/%i/ghtoken.socket ]; do sleep 1; done'
16-
ExecStartPre=/bin/bash -c 'while [ ! -e /etc/actions-runner/%i/ghtoken.socket ]; do sleep 1; done'
15+
ExecStartPre=/bin/bash -c 'while [ ! -s /etc/actions-runner/%i/ghtoken.txt ]; do sleep 1; done'
1716

1817
ExecStart=/usr/bin/docker run \
1918
--env-file=/etc/actions-runner/%i/env \
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
#!/usr/bin/env bash
22

33
TOKEN_FILE=$1
4-
TOKEN_PIPE=$2
4+
OUTPUT_FILE=$2
55

6-
echo "Starting gh_cat_token.sh with TOKEN_FILE=${TOKEN_FILE}, TOKEN_PIPE=${TOKEN_PIPE}"
6+
echo "Starting gh_cat_token.sh with TOKEN_FILE=${TOKEN_FILE}, OUTPUT_FILE=${OUTPUT_FILE}"
77

88
# Validate inputs
99
if [[ ! -r "${TOKEN_FILE}" ]]; then
1010
echo "Error: Token file '${TOKEN_FILE}' does not exist or is not readable."
1111
exit 1
1212
fi
1313

14-
if [[ -e "${TOKEN_PIPE}" ]]; then
15-
echo "Removing existing pipe ${TOKEN_PIPE}"
16-
rm -f "${TOKEN_PIPE}"
17-
fi
18-
19-
mkfifo "${TOKEN_PIPE}"
20-
echo "Created FIFO ${TOKEN_PIPE}"
21-
22-
# Write token file contents to pipe
23-
cat "${TOKEN_FILE}" > "${TOKEN_PIPE}" &
24-
echo "Token written to pipe ${TOKEN_PIPE}"
14+
# Write the token to the output file
15+
cat "${TOKEN_FILE}" > "${OUTPUT_FILE}"
16+
echo "Token written to ${OUTPUT_FILE}"

0 commit comments

Comments
 (0)