Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
file-plus

GitHub Action

PHP Extension Updater

v1.0.0

PHP Extension Updater

file-plus

PHP Extension Updater

Monitors a given list of PHP extensions and opens a PR if newer versions exist

Installation

Copy and paste the following snippet into your .yml file.

              

- name: PHP Extension Updater

uses: pantheon-systems/[email protected]

Learn more about this action in pantheon-systems/action-package-updater

Choose a version

Package Updater GitHub

Test Actively Maintained MIT License

A GitHub action that monitors a list of PHP extensions and opens PRs if newer versions exist. Monitors a dependencies.yml file that defines the current (known) tags and the (GitHub) repository and will check to see if updates are available.

Optionally, this can be used to also update version variables declared in a bash script based on those versions that are updated in dependencies.yml. Currently, an example of the expected syntax can be found in ./fixtures/PHP_EXTENSION_VERSIONS.

Inputs

dependencies-yml

Required The path to your dependencies.yml file. A valid dependencies.yml file is required and the action expects that you define the path to the file.

output-file

An optional additional file to update version numbers on based on updated versions in dependencies.yml. See ./fixtures/PHP_EXTENSION_VERSIONS for a current example of a valid output-file. In the future, additional use cases may be added.

default-branch

The name of default branch of the repository running the GitHub Action. Defaults to main -- if your repository is using master or some other pattern for the repository's default branch, you must define this value.

dry-run

Whether to run the action without actually pushing any changes to the repository. If left at the default (false), a PR will be created. If you would like to evaluate the output of the changes first, you can run the script with dry-run set to true and you will see output similar this test run

Example Usage

A full example yml file is illustrated below:

name: Package Updater
on:
  schedule:
    - cron: '0 * * * *'
jobs:
  updater:
    runs-on: ubuntu-latest
    name: Run Package Updater
    steps:
      - uses: actions/checkout@v3
      - uses: pantheon-systems/action-package-updater@v1
        with:
          dependencies-yml: ./dependencies.yml

Running on a Schedule

This action is designed to be run on a cron schedule. In the example above, we're running the action once daily at midnight. For more information about the schedule trigger, refer to the Events that trigger workflows documentation.

dependencies.yml

The dependencies.yml file expects a specific schema and validates that schema as part of the action run. An example dependencies.yml file can be referenced below:

dependencies:
  yq:
    current_tag: v4.34.2
    repo: mikefarah/yq

Currently, the action supports GitHub projects exclusively. In the future, we may extend the repo key to allow other repositories to check as well. The current_tag value will be updated as part of the action and must match how those tags or releases exist in the repository. Similarly, a repository with the <author>/<project> defined in the repo field ust already exist.