Skip to content

Commit 5cf910d

Browse files
committed
update workflows
1 parent 9e7d85d commit 5cf910d

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

.github/actions/2-multiplication/2-feed/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ runs:
133133
[Service]
134134
Type=oneshot
135135
RemainAfterExit=true
136-
ExecStart=/sbin/iptables -A INPUT -p tcp --match multiport --dports 80,5432,6379 -j ACCEPT
136+
ExecStart=/sbin/iptables -A INPUT -p tcp --match multiport --dports 80,5432,6379,8080 -j ACCEPT
137137
138138
- path: /etc/systemd/system/runner1.service
139139
permissions: "0644"

.github/entrypoint/artifact.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ jekyll_build() {
123123

124124
fi
125125

126-
# Fetch SHA, encode new content, and update in one step
127-
gh api --method PUT /repos/${TARGET_REPOSITORY}/contents/.github/workflows/main.yml \
128-
-f sha="$(gh api /repos/${TARGET_REPOSITORY}/contents/.github/workflows/main.yml --jq '.sha')" \
129-
-f message="Update file" -f content="$(base64 -w0 .github/workflows/main.yml)" > /dev/null
130-
131126
}
132127

133128
# Define the next repository function using jq

.github/entrypoint/init.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ git config --global --add safe.directory "${GITHUB_WORKSPACE}"
1414
git config --global credential.helper store
1515
echo "https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com" > ~/.git-credentials
1616

17-
# Get current repo name in owner/repo format
18-
CURRENT_REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
19-
20-
# Get list of all repositories (user and org)
21-
ALL_REPOS=$(gh repo list --limit 1000 --json nameWithOwner -q '.[].nameWithOwner')
22-
23-
# Loop through all repos and cancel runs except current one
24-
for repo in $ALL_REPOS; do
25-
if [ "$repo" != "$CURRENT_REPO" ]; then
26-
echo "Canceling runs in $repo"
27-
gh api -X POST "/repos/$repo/actions/runs/cancel" || echo "Failed to cancel runs in $repo"
28-
else
29-
echo "Skipping current repo: $repo"
30-
fi
31-
done
32-
3317
export RERUN_RUNNER=$(curl -s -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3+json" \
3418
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/variables/RERUN_RUNNER" | jq -r '.value')
3519
export TARGET_REPOSITORY=$(curl -s -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3+json" \
@@ -70,7 +54,21 @@ if [[ -z ${PASS} ]] || [[ "${PASS}" == "true" ]]; then
7054
echo -e "\n$hr\nCONFIG\n$hr"
7155
mv -f /home/runner/work/_actions/eq19/eq19/v2/.github/templates/jekyll_config.yml $RUNNER_TEMP/_config.yml
7256
export PATH=/home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint:$PATH && artifact.sh
73-
57+
58+
# Loop through all repos and cancel runs except current one
59+
#ALL_REPOS=""
60+
#ORGS=$(gh api user/orgs --jq '.[].login')
61+
#CURRENT_REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
62+
#ALL_REPOS+=$(gh repo list --limit 1000 --json nameWithOwner -q '.[].nameWithOwner')
63+
#for org in $ORGS; do ALL_REPOS+=$(gh repo list $org --limit 1000 --json nameWithOwner -q '.[].nameWithOwner'); done
64+
#for REPO in $ALL_REPOS; do
65+
#if [ "$REPO" != "$CURRENT_REPO" ]; then
66+
#RUNS=$(gh api "repos/$REPO/actions/runs?status=in_progress" --jq '.workflow_runs[].id')
67+
#RUNS+=" $(gh api "repos/$REPO/actions/runs?status=queued" --jq '.workflow_runs[].id')"
68+
#for RUN_ID in $RUNS; do gh api -X POST "repos/$REPO/actions/runs/$RUN_ID/force-cancel"; done
69+
#fi
70+
#done
71+
7472
PARAMS_JSON=$(curl -s -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3+json" \
7573
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/variables/PARAMS_JSON" | jq -r '.value')
7674
echo "${PARAMS_JSON}" | jq '.' > $1/user_data/strategies/fibbo.json
@@ -112,6 +110,11 @@ if [[ "${JOBS_ID}" == "1" ]]; then
112110
cd $1 && javac -d user_data/ft_client/test_client javaCode/Main.java
113111
cd $GITHUB_WORKSPACE && rm -rf user_data && mv -f $1/user_data . && ls -al .
114112

113+
# Fetch SHA, encode new content, and update in one step
114+
gh api --method PUT /repos/${TARGET_REPOSITORY}/contents/.github/workflows/main.yml \
115+
-f sha="$(gh api /repos/${TARGET_REPOSITORY}/contents/.github/workflows/main.yml --jq '.sha')" \
116+
-f message="Update file" -f content="$(base64 -w0 .github/workflows/main.yml)" > /dev/null
117+
115118
fi
116119

117120
elif [[ "${JOBS_ID}" == "2" ]]; then

0 commit comments

Comments
 (0)