Update ade20k1.py #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR-CI | |
on: | |
pull_request: | |
branches: [ main ] | |
env: | |
REPO_NAME: Wuyunfan-BUPT/help | |
HEADER: "-H \"Accept: application/vnd.github+json\" -H \"Authorization: Bearer ${{ secrets.ACTION_TOKEN }}\" -H \"X-GitHub-Api-Version: 2022-11-28\"" | |
BASE_URL: https://api.github.com/repos/${REPO_NAME}/actions/variables | |
jobs: | |
printTest: | |
name: print test | |
runs-on: ubuntu-latest | |
if: ${{ github.event.issue.pull_request }} | |
steps: | |
- name: print issue number | |
run: | | |
echo ${NUMBER} | |
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/Wuyunfan-BUPT/help/issues/${NUMBER}/comments -d "{\"body\":\"https://github.com/Wuyunfan-BUPT/help/actions/runs/${{ github.run_id }}\"}" | |
env: | |
NUMBER: ${{ github.event.issue.number }} | |
- name: print github.job | |
run: | | |
sleep 10 | |
echo ${{ github.job }} | |
- name: generate TEMP_VARI | |
run: | | |
curl -L -X POST ${{ env.HEADER }} ${{ env.BASE_URL }} -d "{\"name\":\"VARI_${{ github.run_id }}\",\"value\":\"waiting\"}" | |
exit 1 | |
# - name: set IS_END values | |
# run: | | |
# curl -L -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/Wuyunfan-BUPT/help/actions/variables/ABC -d '{"name":"ABC","value":"waiting"}' | |
showResult: | |
name: show result | |
needs: [printTest] | |
runs-on: ubuntu-latest | |
steps: | |
- name: print GITHUB_RUN_ID | |
run: | | |
echo ${{ github.run_id }} | |
- name: print github.job | |
run: | | |
echo ${{ github.job }} | |
echo ${{ env.BASE_URL }} | |
- name: waitting result | |
run: | | |
values=`curl -L ${{ env.HEADER }} ${{ env.BASE_URL }} | jq -r '.variables[] | select(.name == "VARI_${{ github.run_id }}") | .value'` | |
while [ ${values} == "waiting" ] | |
do | |
echo "${values}..." | |
sleep 2 | |
values=`curl -L ${{ env.HEADER }} ${{ env.BASE_URL }} | jq -r '.variables[] | select(.name == "VARI_${{ github.run_id }}") | .value'` | |
done | |
echo ${values} | |
echo "https://github.com/${{ env.REPO_NAME }}/actions/runs/${values}" >> $GITHUB_STEP_SUMMARY | |
- name: delete variables | |
run: | | |
curl -L -X DELETE ${{ env.HEADER }} ${{ env.BASE_URL }}/VARI_${{ github.run_id }} | |