diff --git a/.github/workflows/delete_runs.yml b/.github/workflows/delete_runs.yml deleted file mode 100644 index 968fbe7..0000000 --- a/.github/workflows/delete_runs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: delete_runs - -on: - schedule: - - cron: '0 22 * * *' # 北京时间早上6点 - - watch: - types: [started] - - -jobs: - delete_runs: - runs-on: ubuntu-latest - steps: - - - name: new delete.py - run: | - cat << EOF > delete.py - import requests - # Define API endpoint and headers - url = 'https://api.github.com/repos/xyazzrany/Action_Magisk_PATCHE/actions/runs' - headers = {'Authorization': 'Bearer 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'} - # Get list of workflow runs - response = requests.get(url, headers=headers) - response_json = response.json() - runs = response_json['workflow_runs'] - # Loop through workflow runs and delete them - for run in runs: - # Define API endpoint for deleting workflow run - delete_url = f"{url}/{run['id']}" - # Send DELETE request to API - delete_response = requests.delete(delete_url, headers=headers) - # Print ID and status code of deleted workflow run - print(f"Deleted workflow run {run['id']}. Status code: {delete_response.status_code}") - EOF - - - name: use delete.py - run: | - pip3 install requests - python3 delete.py - - - -