mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-21 03:32:08 +00:00
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
name: Update outdated packages
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 20 * * 1-4'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-dependencies:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install pip-tools
|
|
run: |
|
|
python -m venv venv
|
|
source venv/bin/activate
|
|
python -m pip install --upgrade pip pip-tools
|
|
|
|
- name: Upgrade outdated packages
|
|
run: |
|
|
items=($(
|
|
jq -r '.[1:]' "scripts/make_release_requirements.json" |
|
|
jq -r '.[] | "\(.name)|\(.version)"'
|
|
))
|
|
for item in "${items[@]}"; do
|
|
IFS='|' read -r "package_name" "package_version" <<< "${item}"
|
|
echo "found outdated package:"
|
|
echo "name: ${package_name}"
|
|
echo "version: ${package_version}"
|
|
curl
|
|
--request "POST" \
|
|
--silent \
|
|
--header "Accept: application/vnd.github+json" \
|
|
--header "Authorization: Bearer ${TOKEN}" \
|
|
"https://api.github.com/repos/php-curl-class/php-curl-class/actions/workflows/outdated-update-package.yml/dispatches" \
|
|
--data "{\"ref\":\"main\",\"inputs\":{\"package_name\":\"${package_name}\",\"package_version\":\"${package_version}\"}}"
|
|
done
|
|
|
|
echo "done"
|
|
env:
|
|
TOKEN: ${{ secrets.GITHUB_TOKEN }} |