Add scheduled GitHub Action task
This commit is contained in:
39
README.md
39
README.md
@@ -1,2 +1,41 @@
|
||||
# card-api
|
||||
|
||||
## GitHub Action: daily task
|
||||
|
||||
This repository includes a scheduled GitHub Action at .github/workflows/daily-task.yml.
|
||||
|
||||
### Trigger mode
|
||||
|
||||
- Runs every day at 02:00 UTC
|
||||
- Can also be started manually from the GitHub Actions page
|
||||
|
||||
### Required configuration
|
||||
|
||||
Configure these repository secrets before enabling the workflow:
|
||||
|
||||
- TARGET_URL: target API endpoint to call
|
||||
|
||||
Optional secrets:
|
||||
|
||||
- AUTH_TOKEN: bearer token appended to the Authorization header
|
||||
- REQUEST_BODY: raw JSON string sent as the request body
|
||||
- HEADERS_JSON: JSON object string for extra request headers
|
||||
|
||||
Optional repository variables:
|
||||
|
||||
- HTTP_METHOD: defaults to GET
|
||||
- EXPECTED_STATUS: defaults to 200
|
||||
- RETRY_COUNT: defaults to 3
|
||||
- RETRY_DELAY_MS: defaults to 5000
|
||||
|
||||
### Behavior
|
||||
|
||||
The workflow runs scripts/daily-task.js, which:
|
||||
|
||||
- calls the configured endpoint
|
||||
- validates the returned status code
|
||||
- retries on failure
|
||||
- exits with a non-zero code when all retries fail
|
||||
|
||||
If you want this action to do something more specific, such as syncing data, generating reports, or updating files in the repository, the script can be extended from the same entry point.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user