mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-24 01:59:37 +00:00
7cd99dbbac
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
81 lines
2.9 KiB
YAML
81 lines
2.9 KiB
YAML
name: Track outdated dependencies
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 18 * * 1-4'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Gather requirements
|
|
id: check-outdated
|
|
run: |
|
|
python -m venv venv
|
|
source venv/bin/activate
|
|
python -m pip install --upgrade pip
|
|
pip install --requirement scripts/make_release_requirements.txt
|
|
outdated="$(pip list --outdated --format json | jq)"
|
|
outdated_count="$(echo "$outdated" | jq 'length')"
|
|
echo "${outdated}" | jq "[{\"outdated_count\":\"${outdated_count}\"}] + ." > scripts/make_release_requirements.json
|
|
git diff --color
|
|
changes="$(git diff)"
|
|
delimiter="$(openssl rand -hex 8)"
|
|
echo "changes<<${delimiter}" >> "${GITHUB_OUTPUT}"
|
|
echo "${changes}" >> "${GITHUB_OUTPUT}"
|
|
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
|
|
|
|
- name: Create or update pull request
|
|
id: cpr
|
|
uses: peter-evans/create-pull-request@v7
|
|
with:
|
|
commit-message: Update outdated dependencies list
|
|
labels: cleanup-no-release-required, dependencies, github_actions
|
|
title: ⬆ Update outdated dependencies list
|
|
body: |
|
|
```diff
|
|
${{ steps.check-outdated.outputs.changes }}
|
|
```
|
|
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
branch: create-pull-request/outdated
|
|
committer: GitHub <noreply@github.com>
|
|
delete-branch: true
|
|
token: ${{ secrets.PHP_CURL_CLASS_BOT_TOKEN }}
|
|
push-to-fork: php-curl-class-helper/php-curl-class
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_BOT_TOKEN }}
|
|
|
|
- name: Pull request created or updated
|
|
if: ${{ steps.cpr.outputs.pull-request-number }}
|
|
run: |
|
|
echo "Pull request: ${{ steps.cpr.outputs.pull-request-url }}"
|
|
|
|
- name: Approve outdated dependencies pull request
|
|
if: ${{ steps.cpr.outputs.pull-request-number }}
|
|
run: |
|
|
review_status="$(
|
|
gh pr view "${PR_URL}" \
|
|
--json="reviewDecision" \
|
|
--jq=".reviewDecision"
|
|
)"
|
|
echo "Pull request review status: ${review_status}"
|
|
if [[ "${review_status}" != "APPROVED" ]]; then
|
|
gh pr review --approve "${PR_URL}"
|
|
fi
|
|
env:
|
|
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
|
|
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_TOKEN }}
|
|
|
|
- name: Enable auto-merge for outdated dependencies pull request
|
|
if: ${{ steps.cpr.outputs.pull-request-number }}
|
|
run: |
|
|
gh pr merge --auto --merge "${PR_URL}"
|
|
env:
|
|
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
|
|
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_TOKEN }} |