@@ -119,7 +119,7 @@ runs:
119119 gh api --method DELETE -H "${HEADER}" /repos/${{ github.repository }}/actions/runners/${RUNNER_ID}
120120 fi
121121
122- /home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh ${{ inputs.action_path }}
122+ bash /home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh ${{ inputs.action_path }}
123123 mv -f /home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/dockerfile/* ${{ inputs.action_path }}/
124124
125125 - name : View context attributes
@@ -137,6 +137,15 @@ runs:
137137 # path: ~/.cache/pip
138138 # key: ${{ runner.os }}-pip
139139
140+ - name : 💎 Set ID Token
141+ id : ' auth'
142+ uses : ' google-github-actions/auth@v2'
143+ with :
144+ token_format : ' id_token'
145+ create_credentials_file : false
146+ credentials_json : ${{ inputs.credentials }}
147+ id_token_audience : ' https://us-central1-feedmapping.cloudfunctions.net/function'
148+
140149 - name : Install dependencies
141150 shell : bash
142151 env :
@@ -166,6 +175,7 @@ runs:
166175
167176 # #Ref: https://github.com/tsoding/JelloVM
168177 # cd ${{ inputs.action_path }} && javac javaCode/Main.java
178+ python user_data/ft_client/test_client/app.py output.txt
169179
170180 # #Ref: https://github.com/eq19/maps/tree/v3/pythonCode
171181 # #python ${{ github.workspace }}/.github/entrypoint/artifact/python/gellmann.py
@@ -180,50 +190,30 @@ runs:
180190 - name : 🚀 Initiate Lexer
181191 uses :
devcontainers/[email protected] 182192 with :
183- runCmd : ls -al /
184193 skipContainerUserIdUpdate : true
185194 imageName : ${{ inputs.image_name }}
186195 imageTag : target-${{ github.run_number }}
187196 configFile : ${{ inputs.action_path }}/.devcontainer.json
188197 push : ${{ env.RERUN_RUNNER == 'true' && 'always' || 'never' }}
189-
190- - name : 💎 Delete 15 Oldest Docker Images
191- id : variables
198+ runCmd : bash user_data/ft_client/test_client/maps.sh
199+ env : |
200+ ID=${{ env.ID }}
201+ GH_TOKEN=${{ env.GH_TOKEN }}
202+ REMOTE_REPO=${{ env.REMOTE_REPO }}
203+ BEARER=${{ steps.auth.outputs.id_token }}
204+ GITHUB_REPOSITORY=${{ github.repository }}
205+ TARGET_REPOSITORY=${{ env.TARGET_REPOSITORY }}
206+ WORKSPACE=/workspaces/${{ github.event.repository.name }}
207+ OUTPUT=user_data/ft_client/test_client/results/output.txt
208+ ARTIFACT=user_data/ft_client/test_client/results/orgs.json
209+
210+ - name : 🗑️ Delete Docker Tags AND Images
211+ id : delete_images
192212 shell : bash
193213 env :
194214 IMAGE_NAME : " ${{ inputs.image_name }}"
195215 HUB_USERNAME : " ${{ inputs.hub_username }}"
196216 HUB_PASSWORD : " ${{ inputs.hub_password }}"
197- MAX_DELETIONS : 15 # Hardcoded to delete exactly 15 per run
217+ MAX_DELETIONS : 15
198218 run : |
199- # Extract namespace/repo
200- NAMESPACE=${IMAGE_NAME%/*}
201- REPO_NAME=${IMAGE_NAME#*/}
202-
203- BASE_NAME=$(basename ${{ inputs.image_name }})
204- HUB_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${{ inputs.hub_username }}\", \"password\": \"${{ inputs.hub_password }}\"}" https://hub.docker.com/v2/users/login/ | jq -r .token)
205- IFS=', '; array=($(curl -L -s 'https://registry.hub.docker.com/v2/repositories/${{ inputs.image_name }}/tags?page_size=1024' | jq -rc '."results"[]["name"]' | yq eval -P | sed "s/ /, /g"))
206- for ((i=0; i < ${#array[@]}; i++)); do
207- if [ "${array[$i]}" != "latest" ]; then
208- curl -s -i -X DELETE -H "Accept: application/json" -H "Authorization: JWT $HUB_TOKEN" https://hub.docker.com/v2/namespaces/${{ inputs.hub_username }}/repositories/$BASE_NAME/tags/${array[$i]}
209- echo "deleted: ${{ inputs.image_name }}:${array[$i]}"
210- fi
211- done
212-
213- # Get all untagged images from Docker Hub, sorted oldest first
214- IMAGES=$(curl -s -H "Authorization: JWT $HUB_TOKEN" \
215- "https://hub.docker.com/v2/repositories/$IMAGE_NAME/tags/?page_size=100&ordering=last_updated" \
216- | jq -r '.results[] | select(.tag == null or .tag == "") | .digest' \
217- | head -n $MAX_DELETIONS)
218-
219- # Delete exactly MAX_DELETIONS oldest images
220- DELETED=0
221- for SHA in $IMAGES; do
222- echo "🗑️ Deleting image $((DELETED+1))/$MAX_DELETIONS: $IMAGE_NAME@${SHA:0:12}..."
223- RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
224- -H "Authorization: JWT $HUB_TOKEN" \
225- "https://hub.docker.com/v2/repositories/$IMAGE_NAME/manifests/$SHA")
226-
227- [ "$RESPONSE" -eq 202 ] && ((DELETED++)) || echo "❌ Failed (HTTP $RESPONSE)"
228- done
229- echo "✅ Successfully deleted $DELETED/$MAX_DELETIONS oldest images"
219+ ./.github/entrypoint/remote.sh
0 commit comments