Files
php-curl-class/.github/workflows/outdated-update-package.yml
T
dependabot[bot] 43138d2f3d ⬆ Bump actions/checkout from 6 to 7 (#1125)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [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/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  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>
2026-06-19 16:06:40 -04:00

88 lines
3.0 KiB
YAML

name: Update outdated package
on:
workflow_dispatch:
inputs:
package_name:
required: true
type: string
package_version:
required: true
type: string
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install pip-tools
run: |
python -m venv venv
source venv/bin/activate
python -m pip install pip-tools
- name: Upgrade outdated package
env:
PACKAGE_NAME: ${{ github.event.inputs.package_name }}
PACKAGE_VERSION: ${{ github.event.inputs.package_version }}
run: |
source venv/bin/activate
set -x
echo "Upgrading ${PACKAGE_NAME} to version ${PACKAGE_VERSION}"
upgrade_package="${PACKAGE_NAME}==${PACKAGE_VERSION}"
pip-compile \
--upgrade-package="${upgrade_package}" \
--output-file="scripts/make_release_requirements.txt" \
"scripts/make_release_requirements.in"
- name: Create or update pull request
id: cpr
uses: peter-evans/create-pull-request@v8
with:
commit-message: "Update package ${{ github.event.inputs.package_name }}"
labels: cleanup-no-release-required, dependencies, github_actions
title: ⬆ Update ${{ github.event.inputs.package_name }}
body: "Updating ${{ github.event.inputs.package_name }}"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: "create-pull-request/upgrade-${{ github.event.inputs.package_name }}"
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: Enable auto-merge for pull request
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr merge --auto --squash "${PR_URL}"
env:
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve update
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 }}