Skip to content

Bump validator from 13.12.0 to 13.15.20 in /wifi_asset_tracking/dashboard/backend #6

Bump validator from 13.12.0 to 13.15.20 in /wifi_asset_tracking/dashboard/backend

Bump validator from 13.12.0 to 13.15.20 in /wifi_asset_tracking/dashboard/backend #6

name: 01-CI-Checking
on:
pull_request:
types: [opened, synchronize, edited]
jobs:
ci-check:
runs-on: ubuntu-latest
if: github.repository_visibility != 'public' && !contains(github.event.pull_request.body, 'SKIP_CI')
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Env
run: |
export REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)
echo "repo=$REPO_NAME" >> $GITHUB_ENV
- name: Trigger Check-Time Workflow
id: trigger
run: |
response=$(curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/workflows/wifi_applications.yml/dispatches \
-d '{"ref":"main","inputs":{"repo_name":"${{ env.repo }}" ,"src_branch":"${{ github.event.pull_request.head.ref }}" ,"dest_branch":"${{ github.event.pull_request.base.ref }}" ,"pr_id":"${{ github.event.pull_request.number }}" ,"commit_sha":"${{ github.event.pull_request.head.sha }}"}}')
echo "Triggered workflow: $response"
if echo "$response" | grep -q '"message": "Not Found"'; then
echo "Error: Workflow or repository not found. Please check the repository name, workflow file name, and branch name."
exit 1
fi
- name: Wait for Check-Time Workflow to Complete
id: wait
env:
TIMEOUT: 3600
run: |
sleep 30
run_id=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs \
| jq '.workflow_runs[] | select(.name=="wifi_applications") | .id' | head -n 1)
echo "Run ID: https://github.com/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id"
start_time=$(date +%s)
while true; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -ge $TIMEOUT ]; then
echo "Token generated by Github Apps expired."
exit 0
fi
status=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id \
| jq -r '.status')
conclusion=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id \
| jq -r '.conclusion')
echo "Status: $status, Conclusion: $conclusion"
if [[ "$status" == "completed" ]]; then
if [[ "$conclusion" == "success" ]]; then
echo "Workflow completed successfully."
exit 0
else
echo "Workflow failed."
exit 1
fi
fi
sleep 30
done