Skip to content

Commit ae07f40

Browse files
committed
update workflows
1 parent 1cbbda4 commit ae07f40

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/actions/4-identition/6-grammar/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,6 @@ runs:
189189
-H "Accept: application/vnd.github.v3+json" \
190190
"https://api.github.com/repos/$TARGET_REPOSITORY/dispatches" \
191191
-d '{"event_type": "trigger_action", "client_payload": {"env": "prod", "version": "1.0"}}'
192-
echo -e "\nDispatched to https://github.com/${{ env.TARGET_REPOSITORY }}/actions"
193192
fi
193+
echo -e "\nDispatched to https://github.com/${{ env.TARGET_REPOSITORY }}/actions"
194194
fi

.github/entrypoint/init.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ if [[ "${JOBS_ID}" == "1" ]]; then
9191
"https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches" \
9292
-d '{"event_type": "retry_workflow", "client_payload": {"original_run_id": "${GITHUB_RUN_ID}"}}'
9393
exit 1
94+
else
95+
HEADER="Accept: application/vnd.github+json"
96+
RESPONSE=$(gh api -H "${HEADER}" repos/$TARGET_REPOSITORY/actions/runners)
97+
STATUS=$(echo "$RESPONSE" | jq -r --arg NAME "$RUNNER_TITLE" '.runners[] | select(.name == $NAME).status')
98+
99+
if [[ "$STATUS" == "offline" ]]; then
100+
RUNNER_ID=$(gh api -H "${HEADER}" /repos/$TARGET_REPOSITORY/actions/runners --jq '.runners.[].id')
101+
gh api --method DELETE -H "${HEADER}" /repos/$TARGET_REPOSITORY/actions/runners/${RUNNER_ID}
102+
fi
94103
fi
95104

96105
cd $GITHUB_WORKSPACE
@@ -100,7 +109,7 @@ if [[ "${JOBS_ID}" == "1" ]]; then
100109
#Ref: https://github.com/tsoding/JelloVM
101110
javac -d $1/user_data/ft_client/test_client $1/javaCode/Main.java
102111

103-
rm -rf user_data && mv -f $1/user_data .
112+
rm -rf .dockerignore user_data && mv -f $1/user_data .
104113
echo -e "\n$hr\nWORKSPACE\n$hr" && ls -al .
105114

106115
# Fetch SHA, encode new content, and update in one step

0 commit comments

Comments
 (0)