@@ -12,13 +12,12 @@ runs:
12
12
run : |
13
13
set -e
14
14
15
- owner=${{ github.repository_owner }}
16
- echo "owner: $owner"
17
- if [[ $owner != "coder" ]]; then
15
+ echo "owner: $REPO_OWNER"
16
+ if [[ "$REPO_OWNER" != "coder" ]]; then
18
17
echo "Not a pull request from the main repo, skipping..."
19
18
exit 0
20
19
fi
21
- if [[ -z "${{ inputs.api-key } }" ]]; then
20
+ if [[ -z "${DATADOG_API_KEY }" ]]; then
22
21
# This can happen for dependabot.
23
22
echo "No API key provided, skipping..."
24
23
exit 0
@@ -31,37 +30,38 @@ runs:
31
30
32
31
TMP_DIR=$(mktemp -d)
33
32
34
- if [[ "${{ runner.os } }" == "Windows" ]]; then
33
+ if [[ "${RUNNER_OS }" == "Windows" ]]; then
35
34
BINARY_PATH="${TMP_DIR}/datadog-ci.exe"
36
35
BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_win-x64"
37
- elif [[ "${{ runner.os } }" == "macOS" ]]; then
36
+ elif [[ "${RUNNER_OS }" == "macOS" ]]; then
38
37
BINARY_PATH="${TMP_DIR}/datadog-ci"
39
38
BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_darwin-arm64"
40
- elif [[ "${{ runner.os } }" == "Linux" ]]; then
39
+ elif [[ "${RUNNER_OS }" == "Linux" ]]; then
41
40
BINARY_PATH="${TMP_DIR}/datadog-ci"
42
41
BINARY_URL="https://github.com/DataDog/datadog-ci/releases/download/${BINARY_VERSION}/datadog-ci_linux-x64"
43
42
else
44
- echo "Unsupported OS: ${{ runner.os }} "
43
+ echo "Unsupported OS: $RUNNER_OS "
45
44
exit 1
46
45
fi
47
46
48
- echo "Downloading DataDog CI binary version ${BINARY_VERSION} for ${{ runner.os }} ..."
47
+ echo "Downloading DataDog CI binary version ${BINARY_VERSION} for $RUNNER_OS ..."
49
48
curl -sSL "$BINARY_URL" -o "$BINARY_PATH"
50
49
51
- if [[ "${{ runner.os } }" == "Windows" ]]; then
50
+ if [[ "${RUNNER_OS }" == "Windows" ]]; then
52
51
echo "$BINARY_HASH_WINDOWS $BINARY_PATH" | sha256sum --check
53
- elif [[ "${{ runner.os } }" == "macOS" ]]; then
52
+ elif [[ "${RUNNER_OS }" == "macOS" ]]; then
54
53
echo "$BINARY_HASH_MACOS $BINARY_PATH" | shasum -a 256 --check
55
- elif [[ "${{ runner.os } }" == "Linux" ]]; then
54
+ elif [[ "${RUNNER_OS }" == "Linux" ]]; then
56
55
echo "$BINARY_HASH_LINUX $BINARY_PATH" | sha256sum --check
57
56
fi
58
57
59
58
# Make binary executable (not needed for Windows)
60
- if [[ "${{ runner.os } }" != "Windows" ]]; then
59
+ if [[ "${RUNNER_OS }" != "Windows" ]]; then
61
60
chmod +x "$BINARY_PATH"
62
61
fi
63
62
64
63
"$BINARY_PATH" junit upload --service coder ./gotests.xml \
65
- --tags os:${{runner.os}} --tags runner_name:${{runner.name}}
64
+ --tags " os:${RUNNER_OS}" --tags " runner_name:${RUNNER_NAME}"
66
65
env :
66
+ REPO_OWNER : ${{ github.repository_owner }}
67
67
DATADOG_API_KEY : ${{ inputs.api-key }}
0 commit comments