diff --git a/.editorconfig b/.editorconfig index 7122a7a..2bf0901 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,11 +2,15 @@ root = true [*] charset = utf-8 +end_of_line = lf indent_size = 4 indent_style = space insert_final_newline = true trim_trailing_whitespace = true +[*.md] +indent_size = 2 + [*.{yaml,yml}] indent_size = 2 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..21dd534 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +* @ergebnis-bot @localheinz diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6a730e1..141a83a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ # CONTRIBUTING -We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system. +We use [GitHub Actions](https://github.com/features/actions) as a continuous integration system. For details, take a look at the following workflow configuration files: @@ -10,12 +10,12 @@ For details, take a look at the following workflow configuration files: ## Coding Standards -We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files. +We use [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files. If you do not have `yamllint` installed yet, run ```sh -$ brew install yamllint +brew install yamllint ``` to install `yamllint`. @@ -23,7 +23,7 @@ to install `yamllint`. Run ```sh -$ make coding-standards +make coding-standards ``` to detect coding standard violations. @@ -33,7 +33,7 @@ to detect coding standard violations. Run ```sh -$ make +make ``` to detect coding standard violations! @@ -43,7 +43,7 @@ to detect coding standard violations! :bulb: Run ```sh -$ make help +make help ``` to display a list of available targets with corresponding descriptions. diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..cf38dba --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +The following versions of `ergebnis/.github` have active support: + +- `^1.10.0` + +## Unsupported Versions + +The following versions of `ergebnis/.github` have reached their end of life: + +- `<1.10.0` + +## Reporting a Vulnerability + +If you believe that you have found a security vulnerability, please send an email to `am@localheinz.com`. Ensure to include all details required to understand the severity of the issue. diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 56% rename from .github/dependabot.yml rename to .github/dependabot.yaml index 9dc98f8..6b0897f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yaml @@ -1,4 +1,4 @@ -# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates +# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 @@ -12,7 +12,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -23,7 +23,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -34,7 +34,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -45,7 +45,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -56,7 +56,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -67,7 +67,7 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" - commit-message: include: "scope" @@ -78,4 +78,48 @@ updates: open-pull-requests-limit: 10 package-ecosystem: "github-actions" schedule: - interval: "daily" + interval: "weekly" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/actions/oh-dear/check/request-run" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "weekly" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/actions/oh-dear/maintenance-period/start" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "weekly" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/actions/oh-dear/maintenance-period/stop" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "weekly" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/actions/phive/install" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "weekly" diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..5226faf --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,6 @@ +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes + +changelog: + exclude: + authors: + - "dependabot" diff --git a/.github/settings.yml b/.github/settings.yml index 5ec4346..5d40ff0 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,4 +1,4 @@ -# https://github.com/probot/settings +# https://github.com/repository-settings/app branches: - name: "main" @@ -13,8 +13,8 @@ branches: require_code_owner_reviews: true required_approving_review_count: 1 required_status_checks: - contexts: - - "Coding Standards" + checks: + - context: "Coding Standards" strict: false restrictions: @@ -52,10 +52,6 @@ labels: color: "ee0701" description: "" - - name: "stale" - color: "eeeeee" - description: "" - # https://docs.github.com/en/rest/reference/repos#update-a-repository repository: @@ -66,11 +62,15 @@ repository: default_branch: "main" delete_branch_on_merge: true description: ":heart: Provides default community health files and composite actions for the @ergebnis organization." + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + has_discussions: false has_downloads: false - has_issues: false + has_issues: true has_pages: false has_projects: false has_wiki: false + is_template: false name: ".github" private: false diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 3642c95..ded9d74 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -14,12 +14,14 @@ jobs: runs-on: "ubuntu-latest" + timeout-minutes: 5 + steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" - name: "Lint YAML files" - uses: "ibiqlik/action-yamllint@v3.1.0" + uses: "ibiqlik/action-yamllint@v3.1.1" with: config_file: ".yamllint.yaml" file_or_dir: "." diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 18d55b8..61d417f 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -15,6 +15,8 @@ jobs: runs-on: "ubuntu-latest" + timeout-minutes: 5 + if: > github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && @@ -24,23 +26,23 @@ jobs: steps: - name: "Request review from @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/request-review@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/request-review@1.10.0" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" reviewer: "ergebnis-bot" - name: "Assign @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.10.0" with: - github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" assignee: "ergebnis-bot" + github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" - name: "Approve pull request" - uses: "ergebnis/.github/actions/github/pull-request/approve@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/approve@1.10.0" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" - name: "Merge pull request" - uses: "ergebnis/.github/actions/github/pull-request/merge@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/merge@1.10.0" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 87f7977..9b17703 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,8 +13,23 @@ jobs: runs-on: "ubuntu-latest" + timeout-minutes: 5 + steps: - name: "Create release" - uses: "ergebnis/.github/actions/github/release/create@1.5.1" + uses: "ergebnis/.github/actions/github/release/create@1.10.0" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" + + - name: "Post to twitter.com about release" + uses: "Eomm/why-don-t-you-tweet@v2.0.0" + env: + TWITTER_ACCESS_TOKEN: "${{ secrets.ERGEBNIS_TWITTER_ACCESS_TOKEN }}" + TWITTER_ACCESS_TOKEN_SECRET: "${{ secrets.ERGEBNIS_TWITTER_ACCESS_TOKEN_SECRET }}" + TWITTER_CONSUMER_API_KEY: "${{ secrets.ERGEBNIS_TWITTER_CONSUMER_API_KEY }}" + TWITTER_CONSUMER_API_SECRET: "${{ secrets.ERGEBNIS_TWITTER_CONSUMER_API_KEY_SECRET }}" + with: + tweet-message: | + ❤️ Just released: ${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:${{ env.RELEASE_TAG }}. + + ${{ env.RELEASE_HTML_URL }} diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml index 59fa6c4..1218ec2 100644 --- a/.github/workflows/triage.yaml +++ b/.github/workflows/triage.yaml @@ -13,8 +13,10 @@ jobs: runs-on: "ubuntu-latest" + timeout-minutes: 5 + steps: - name: "Add labels based on branch name" - uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.10.0" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" diff --git a/.yamllint.yaml b/.yamllint.yaml index 2c9e3b6..0f43625 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,7 +1,7 @@ extends: "default" ignore: | - .notes/ + .note/ rules: braces: diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ff47b..d619782 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,63 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased -For a full diff see [`1.6.0...main`][1.6.0...main]. +For a full diff see [`1.9.3...main`][1.9.3...main]. + +### Added + +- Added `github/release/publish` to allow publishing a release ([#215]), by [@localheinz] + +### Changed + +- Added a `draft` input to `github/release/create` to allow creating releases in draft mode ([#214]), by [@localheinz] + +## [`1.9.3`][1.9.3] + +For a full diff see [`1.9.2...1.9.3`][1.9.2...1.9.3]. + +### Fixed + +- Updated `actions/cache` ([#207], [#208], [#209]), by [@dependabot] + +## [`1.9.2`][1.9.2] + +For a full diff see [`1.9.1...1.9.2`][1.9.1...1.9.2]. + +### Fixed + +- Expose `PULL_REQUEST_BRANCH_NAME` instead of overwriting `PULL_REQUEST_NUMBER` environment variable when adding label based on branch name ([#194]), by [@jaymecd] + +## [`1.9.1`][1.9.1] + +For a full diff see [`1.9.0...1.9.1`][1.9.0...1.9.1]. + +### Fixed + +- Fixed invalid attempt to calculate cache key for `phars.xml` with `hashfiles()` function ([#197]), by [@lotyp] + +## [`1.9.0`][1.9.0] + +For a full diff see [`1.8.0...1.9.0`][1.8.0...1.9.0]. + +### Changed + +- Started exposing a `RELEASE_HTML_URL` environment variable after creating a release with `actions/github/release/create` ([#183]), by [@localheinz] + +## [`1.8.0`][1.8.0] + +For a full diff see [`1.7.0...1.8.0`][1.7.0...1.8.0]. + +### Added + +- Added composite action `phive/install` for installing dependencies with [`phive`](https://phar.io) ([#142]), by [@localheinz] + +## [`1.7.0`][1.7.0] + +For a full diff see [`1.6.0...1.7.0`][1.6.0...1.7.0]. + +### Added + +- Added composite actions `oh-dear/check/request-run` for requesting a check run on [ohdear.app](https://ohdear.app) ([#124]), by [@localheinz] ## [`1.6.0`][1.6.0] @@ -122,6 +178,12 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [1.5.0]: https://github.com/ergebnis/.github/releases/tag/1.5.0 [1.5.1]: https://github.com/ergebnis/.github/releases/tag/1.5.1 [1.6.0]: https://github.com/ergebnis/.github/releases/tag/1.6.0 +[1.7.0]: https://github.com/ergebnis/.github/releases/tag/1.7.0 +[1.8.0]: https://github.com/ergebnis/.github/releases/tag/1.8.0 +[1.9.0]: https://github.com/ergebnis/.github/releases/tag/1.9.0 +[1.9.1]: https://github.com/ergebnis/.github/releases/tag/1.9.1 +[1.9.2]: https://github.com/ergebnis/.github/releases/tag/1.9.2 +[1.9.3]: https://github.com/ergebnis/.github/releases/tag/1.9.3 [ca7f15d...1.0.0]: https://github.com/ergebnis/.github/compare/ca7f15d...1.0.0 [1.0.0...1.1.0]: https://github.com/ergebnis/.github/compare/1.0.0...1.1.0 @@ -135,7 +197,13 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [1.4.1...1.5.0]: https://github.com/ergebnis/.github/compare/1.4.1...1.5.0 [1.5.0...1.5.1]: https://github.com/ergebnis/.github/compare/1.5.0...1.5.1 [1.5.1...1.6.0]: https://github.com/ergebnis/.github/compare/1.5.1...1.6.0 -[1.6.0...main]: https://github.com/ergebnis/.github/compare/1.6.0...main +[1.6.0...1.7.0]: https://github.com/ergebnis/.github/compare/1.6.0...1.7.0 +[1.7.0...1.8.0]: https://github.com/ergebnis/.github/compare/1.7.0...1.8.0 +[1.8.0...1.9.0]: https://github.com/ergebnis/.github/compare/1.8.0...1.9.0 +[1.9.0...1.9.1]: https://github.com/ergebnis/.github/compare/1.9.0...1.9.1 +[1.9.1...1.9.2]: https://github.com/ergebnis/.github/compare/1.9.1...1.9.2 +[1.9.2...1.9.3]: https://github.com/ergebnis/.github/compare/1.9.2...1.9.3 +[1.9.3...main]: https://github.com/ergebnis/.github/compare/1.9.3...main [#47]: https://github.com/ergebnis/.github/pull/47 [#48]: https://github.com/ergebnis/.github/pull/48 @@ -154,5 +222,18 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [#87]: https://github.com/ergebnis/.github/pull/87 [#96]: https://github.com/ergebnis/.github/pull/96 [#123]: https://github.com/ergebnis/.github/pull/123 - +[#124]: https://github.com/ergebnis/.github/pull/124 +[#142]: https://github.com/ergebnis/.github/pull/142 +[#183]: https://github.com/ergebnis/.github/pull/183 +[#194]: https://github.com/ergebnis/.github/pull/194 +[#197]: https://github.com/ergebnis/.github/pull/197 +[#207]: https://github.com/ergebnis/.github/pull/207 +[#208]: https://github.com/ergebnis/.github/pull/208 +[#209]: https://github.com/ergebnis/.github/pull/209 +[#214]: https://github.com/ergebnis/.github/pull/214 +[#215]: https://github.com/ergebnis/.github/pull/215 + +[@dependabot]: https://github.com/dependabot +[@jaymecd]: https://github.com/jaymecd [@localheinz]: https://github.com/localheinz +[@lotyp]: https://github.com/lotyp diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 64bf50c..0000000 --- a/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @localheinz diff --git a/FUNDING.yml b/FUNDING.yml deleted file mode 100644 index 4c8ee87..0000000 --- a/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: - - "ergebnis" - - "localheinz" diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cabb837 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,16 @@ +# The MIT License (MIT) + +Copyright (c) 2019-2023 Andreas Möller + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the _Software_), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 6f472b1..ad20f03 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,14 @@ # .github -[![Integrate](https://github.com/ergebnis/.github/workflows/Integrate/badge.svg?branch=main)](https://github.com/ergebnis/.github/actions) -[![Merge](https://github.com/ergebnis/.github/workflows/Merge/badge.svg?branch=main)](https://github.com/ergebnis/.github/actions) -[![Release](https://github.com/ergebnis/.github/workflows/Release/badge.svg?branch=main)](https://github.com/ergebnis/.github/actions) -[![Triage](https://github.com/ergebnis/.github/workflows/Triage/badge.svg?branch=main)](https://github.com/ergebnis/.github/actions) +[![Integrate](https://github.com/ergebnis/.github/workflows/Integrate/badge.svg)](https://github.com/ergebnis/.github/actions) +[![Merge](https://github.com/ergebnis/.github/workflows/Merge/badge.svg)](https://github.com/ergebnis/.github/actions) +[![Release](https://github.com/ergebnis/.github/workflows/Release/badge.svg)](https://github.com/ergebnis/.github/actions) -Provides community health files for the [@ergebnis](https://github.com/ergebnis) organization. - -:bulb: Also see [GitHub Docs: Creating a default community health file](https://docs.github.com/en/github/building-a-strong-community/creating-a-default-community-health-file). +This project provides [community health files](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file) and [composite actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) for the [@ergebnis](https://github.com/ergebnis) organization. ## Composite Actions -This repository provides the following composite actions: +This project provides the following composite actions: - [`ergebnis/.github/actions/composer/determine-cache-directory`](#composer-determine-cache-directory) - [`ergebnis/.github/actions/composer/determine-root-version`](#composer-determine-root-version) @@ -22,8 +19,11 @@ This repository provides the following composite actions: - [`ergebnis/.github/actions/github/pull-request/merge`](#github-pull-request-merge) - [`ergebnis/.github/actions/github/pull-request/request-review`](#github-pull-request-review) - [`ergebnis/.github/actions/github/release/create`](#github-release-create) +- [`ergebnis/.github/actions/github/release/publish`](#github-release-publish) +- [`ergebnis/.github/actions/oh-dear/check/request-run`](#oh-dear-check-request-run) - [`ergebnis/.github/actions/oh-dear/maintenance-period/start`](#oh-dear-maintenance-period-start) - [`ergebnis/.github/actions/oh-dear/maintenance-period/stop`](#oh-dear-maintenance-period-stop) +- [`ergebnis/.github/actions/phive/install`](#phive-install) ### `ergebnis/.github/actions/composer/determine-cache-directory` @@ -48,19 +48,19 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" - name: "Set up PHP" - uses: "shivammathur/setup-php@2.21.2" + uses: "shivammathur/setup-php@2.35.4" with: coverage: "none" php-version: "8.1" - name: "Determine composer cache directory" - uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.5.1" + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.9.3" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v3.0.8" + uses: "actions/cache@v4.2.4" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "composer-${{ hashFiles('composer.lock') }}" @@ -71,7 +71,7 @@ For details, see [`actions/composer/determine-cache-directory/action.yaml`](acti #### Inputs -- `working-directory`, optional: The working directory to use. Defaults to `"'"."`. +- `working-directory`, optional: The working directory to use. Defaults to `"."`. #### Outputs @@ -104,16 +104,16 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" - name: "Set up PHP" - uses: "shivammathur/setup-php@2.21.2" + uses: "shivammathur/setup-php@2.35.4" with: coverage: "none" php-version: "8.1" - name: "Determine composer root version" - uses: "ergebnis/.github/actions/composer/determine-root-version@1.5.1" + uses: "ergebnis/.github/actions/composer/determine-root-version@1.9.3" ``` For details, see [`actions/composer/determine-root-version/action.yaml`](actions/composer/determine-root-version/action.yaml). @@ -129,17 +129,17 @@ none #### Side Effects -The `COMPOSER_ROOT_VERSION` environment variable contains the root version if it has been defined as `branch-alias` in `composer.json`. +- The `COMPOSER_ROOT_VERSION` environment variable contains the root version if it has been defined as `branch-alias` in `composer.json`. -```json -{ - "extra": { - "branch-alias": { - "dev-main": "10.0-dev" + ```json + { + "extra": { + "branch-alias": { + "dev-main": "10.0-dev" + } } } -} -``` + ``` ### `ergebnis/.github/actions/composer/install` @@ -169,26 +169,26 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" - name: "Set up PHP" - uses: "shivammathur/setup-php@2.21.2" + uses: "shivammathur/setup-php@2.35.4" with: coverage: "none" php-version: "8.1" - name: "Determine composer cache directory" - uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.5.1" + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.9.3" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v3.0.8" + uses: "actions/cache@v4.2.4" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" restore-keys: "composer-${{ matrix.dependencies }}-" - name: "Install ${{ matrix.dependencies }} dependencies with composer" - uses: "ergebnis/.github/actions/composer/install@1.5.1" + uses: "ergebnis/.github/actions/composer/install@1.9.3" with: dependencies: "${{ matrix.dependencies }}" ``` @@ -206,22 +206,22 @@ none #### Side Effects -When `dependencies` is set to `"lowest"`, dependencies are installed in the directory specified by `working-directory` with +- When `dependencies` is set to `"lowest"`, dependencies are installed in the directory specified by `working-directory` with -```shell -composer update --ansi --no-interaction --no-progress --prefer-lowest -```` -When `dependencies` is set to `"locked"`, dependencies are installed in the directory specified by `working-directory` with + ```shell + composer update --ansi --no-interaction --no-progress --prefer-lowest + ```` +- When `dependencies` is set to `"locked"`, dependencies are installed in the directory specified by `working-directory` with -```shell -composer install --ansi --no-interaction --no-progress -``` + ```shell + composer install --ansi --no-interaction --no-progress + ``` -When `dependencies` is set to `"highest"`, dependencies are installed in the directory specified by `working-directory` with +- When `dependencies` is set to `"highest"`, dependencies are installed in the directory specified by `working-directory` with -```shell -composer update --ansi --no-interaction --no-progress -```` + ```shell + composer update --ansi --no-interaction --no-progress + ```` ### `ergebnis/.github/actions/github/pull-request/add-assignee` @@ -255,7 +255,7 @@ jobs: steps: - name: "Assign @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.9.3" with: assignee: "ergebnis-bot" github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" @@ -274,7 +274,8 @@ none #### Side Effects -The GitHub user with the username specified in the `assignee` input is assigned to the pull request. +- The GitHub user with the username specified in the `assignee` input is assigned to the pull request. +- The `PULL_REQUEST_NUMBER` environment variable contains the number of the pull request. ### `ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name` @@ -298,7 +299,7 @@ jobs: steps: - name: "Add labels based on branch name" - uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.9.3" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" ``` @@ -317,6 +318,8 @@ none - When the branch name starts with `feature/`, the label `enhancement` is added to the pull request by the user who owns the GitHub token specified with the `github-token` input. - When the branch name starts with `fix/`, the label `bug` is added to the pull request by the user who owns the GitHub token specified with the `github-token` input. +- The `PULL_REQUEST_BRANCH_NAME` environment variable contains the name of the head branch of the pull request. +- The `PULL_REQUEST_NUMBER` environment variable contains the number of the pull request. ### `ergebnis/.github/actions/github/pull-request/approve` @@ -350,7 +353,7 @@ jobs: steps: - name: "Approve pull request" - uses: "ergebnis/.github/actions/github/pull-request/approve@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/approve@1.9.3" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" ``` @@ -367,7 +370,8 @@ none #### Side Effects -The pull request is approved by the user who owns the GitHub token specified with the `github-token` input. +- The pull request is approved by the user who owns the GitHub token specified with the `github-token` input. +- The `PULL_REQUEST_NUMBER` environment variable contains the number of the pull request. ### `ergebnis/.github/actions/github/pull-request/merge` @@ -401,7 +405,7 @@ jobs: steps: - name: "Merge pull request" - uses: "ergebnis/.github/actions/github/pull-request/merge@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/merge@1.9.3" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" ``` @@ -419,7 +423,8 @@ none #### Side Effects -The pull request is merged by the user who owns the GitHub token specified with the `github-token` input. +- The pull request is merged by the user who owns the GitHub token specified with the `github-token` input. +- The `PULL_REQUEST_NUMBER` environment variable contains the number of the pull request. ### `ergebnis/.github/actions/github/pull-request/request-review` @@ -453,7 +458,7 @@ jobs: steps: - name: "Request review from @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/request-review@1.5.1" + uses: "ergebnis/.github/actions/github/pull-request/request-review@1.9.3" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" reviewer: "ergebnis-bot" @@ -472,13 +477,14 @@ none #### Side Effects -A pull request review is requested for the user identified by the value of the `reviewer` input by the user who owns the GitHub token specified with the `github-token` input. +- A pull request review is requested for the user identified by the value of the `reviewer` input by the user who owns the GitHub token specified with the `github-token` input. +- The `PULL_REQUEST_NUMBER` environment variable contains the number of the pull request. ### `ergebnis/.github/actions/github/release/create` This action creates a release. -This is usefull when you automatically want to create releases with [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes). +This is useful when you automatically want to create releases with [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes). ```yaml @@ -497,7 +503,7 @@ jobs: steps: - name: "Create release" - uses: "ergebnis/.github/actions/github/release/create@1.5.1" + uses: "ergebnis/.github/actions/github/release/create@1.9.3" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" ``` @@ -506,7 +512,102 @@ For details, see [`actions/github/release/create/action.yaml`](actions/github/re #### Inputs +- `draft`, optional: Whether to create a draft or a published release. +- `github-token`, required: The GitHub token of a user with permission to create a release. + +#### Outputs + +none + +#### Side Effects + +- A release is created by the user who owns the GitHub token specified with the `github-token` input. +- The `RELEASE_HTML_URL` environment variable contains the HTML URL to the release. +- The `RELEASE_ID` environment variable contains the release identifier. +- The `RELEASE_TAG` environment variable contains the release tag. +- The `RELEASE_UPLOAD_URL` environment variable contains the URL for uploading release assets. +- +### `ergebnis/.github/actions/github/release/publish` + +This action publishes a release. + +This is useful when you want to publish a release created in draft mode. + +```yaml + +name: "Release" + +on: + push: + tags: + - "**" + +jobs: + release: + name: "Release" + + runs-on: "ubuntu-latest" + + steps: + - name: "Publish release" + uses: "ergebnis/.github/actions/github/release/publish@1.10.0" + with: + release-id: "9001" + github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" +``` + +For details, see [`actions/github/release/publish/action.yaml`](actions/github/release/publish/action.yaml). + +#### Inputs + - `github-token`, required: The GitHub token of a user with permission to create a release. +- `release-id`, required: The release identifier. + +#### Outputs + +none + +#### Side Effects + +- The release identified by the release identifier is published by the user who owns the GitHub token specified with the `github-token` input. + +### `ergebnis/.github/actions/oh-dear/check/request-run` + +This action requests a [check](https://ohdear.app/docs/general/checks) run on [Oh Dear!](https://ohdear.app). + +```yaml +name: "Deploy" + +on: + push: + branches: + - "main" + +jobs: + deploy: + name: "Deploy" + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v5.0.0" + with: + fetch-depth: 50 + + - name: "Request broken links check on ohdear.app" + uses: "ergebnis/.github/actions/oh-dear/maintenance-period/start@1.9.3" + with: + oh-dear-api-token: "${{ secrets.OH_DEAR_API_TOKEN }}" + oh-dear-check-id: "${{ secrets.OH_DEAR_BROKEN_LINKS_CHECK_ID }}" +``` + +For details, see [`actions/oh-dear/check/request-run/action.yaml`](actions/oh-dear/check/request-run/action.yaml). + +#### Inputs + +- `oh-dear-api-token`, required: The Oh Dear API token of a user with permission to request a check run +- `oh-dear-check-id`, required: Check identifer of an Oh Dear check for which to request a run #### Outputs @@ -514,7 +615,7 @@ none #### Side Effects -A release is created by the user who owns the GitHub token specified with the `github-token` input. +- A check run is requested by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the check identified by the `oh-dear-check-id` input. ### `ergebnis/.github/actions/oh-dear/maintenance-period/start` @@ -536,12 +637,12 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" with: fetch-depth: 50 - name: "Start maintenance period on ohdear.app" - uses: "ergebnis/.github/actions/oh-dear/maintenance-period/start@1.5.1" + uses: "ergebnis/.github/actions/oh-dear/maintenance-period/start@1.9.3" with: oh-dear-api-token: "${{ secrets.OH_DEAR_API_TOKEN }}" oh-dear-site-id: "${{ secrets.OH_DEAR_SITE_ID }}" @@ -560,7 +661,7 @@ none #### Side Effects -A maintenance period is started by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the site identified by the `oh-dear-site-id` input. +- A maintenance period is started by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the site identified by the `oh-dear-site-id` input. ### `ergebnis/.github/actions/oh-dear/maintenance-period/stop` @@ -582,12 +683,12 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.2" + uses: "actions/checkout@v5.0.0" with: fetch-depth: 50 - name: "Stop maintenance period on ohdear.app" - uses: "ergebnis/.github/actions/oh-dear/maintenance-period/stop@1.5.1" + uses: "ergebnis/.github/actions/oh-dear/maintenance-period/stop@1.9.3" with: oh-dear-api-token: "${{ secrets.OH_DEAR_API_TOKEN }}" oh-dear-site-id: "${{ secrets.OH_DEAR_SITE_ID }}" @@ -606,20 +707,87 @@ none #### Side Effects -A maintenance period is stopped by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the site identified by the `oh-dear-site-id` input. +- A maintenance period is stopped by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the site identified by the `oh-dear-site-id` input. + +### `ergebnis/.github/actions/phive/install` + +This action installs dependencies with [`phive`](https://phar.io). + +```yaml +name: "Integrate" + +on: + pull_request: null + push: + branches: + - "main" + +jobs: + tests: + name: "Tests" + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v5.0.0" + + - name: "Set up PHP" + uses: "shivammathur/setup-php@2.35.4" + with: + coverage: "none" + php-version: "8.1" + tools: "phive" + + - name: "Install dependencies with phive" + uses: "ergebnis/.github/actions/phive/install@1.9.3" + with: + trust-gpg-keys: "0x033E5F8D801A2F8D,0x2A8299CE842DD38C" +``` + +For details, see [`actions/phive/install/action.yaml`](actions/phive/install/action.yaml). + +#### Inputs + +- `phive-home`, optional: Which directory to use as `PHIVE_HOME` directory, defaults to `".build/phive"`. +- `trust-gpg-keys`, required: Which GPG keys to trust, a comma-separated list of trusted GPG keys + +#### Outputs + +none + +#### Side Effects + +- Given that `phive` is available, `phive` could find a `phars.xml`, and keys presented by packages are listed using the `trust-gpg-keys` option, dependencies are installed with `phive`. + +The directory configured by the `phive-home` directory is cached using [`actions/cache`](https://github.com/actions/cache). ## Changelog -Please have a look at [`CHANGELOG.md`](CHANGELOG.md). +The maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md). ## Contributing -Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md). +The maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md). ## Code of Conduct -Please have a look at [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md). +The maintainers of this project ask contributors to follow the [code of conduct](CODE_OF_CONDUCT.md). + +## General Support Policy + +The maintainers of this project provide limited support. + +You can support the maintenance of this project by [sponsoring @ergebnis](https://github.com/sponsors/ergebnis). + +## Security Policy + +This project has a [security policy](.github/SECURITY.md). + +## License + +This project uses the [MIT license](LICENSE.md). -## Curious what I am building? +## Social -:mailbox_with_mail: [Subscribe to my list](https://localheinz.com/projects/), and I will occasionally send you an email to let you know what I am working on. +Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter. diff --git a/actions/github/pull-request/add-assignee/action.yaml b/actions/github/pull-request/add-assignee/action.yaml index 8d0d8d6..c3c1599 100644 --- a/actions/github/pull-request/add-assignee/action.yaml +++ b/actions/github/pull-request/add-assignee/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/issues#add-assignees-to-an-issue +# https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run @@ -22,7 +22,7 @@ runs: steps: - name: "Determine pull request number" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | @@ -44,7 +44,7 @@ runs: core.setFailed(`Unable to determine the pull request number for event "${context.eventName}"`); - name: "Add assignee to pull request" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" env: ASSIGNEE: "${{ inputs.assignee }}" with: diff --git a/actions/github/pull-request/add-label-based-on-branch-name/action.yaml b/actions/github/pull-request/add-label-based-on-branch-name/action.yaml index b3c6c54..c19114c 100644 --- a/actions/github/pull-request/add-label-based-on-branch-name/action.yaml +++ b/actions/github/pull-request/add-label-based-on-branch-name/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/issues#add-labels-to-an-issue +# https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run @@ -19,7 +19,7 @@ runs: steps: - name: "Determine pull request number" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | @@ -35,7 +35,7 @@ runs: if (context.eventName == 'workflow_run') { core.exportVariable("PULL_REQUEST_NUMBER", context.payload.workflow_run.pull_requests[0].number); - core.exportVariable("PULL_REQUEST_NUMBER", context.payload.workflow_run.pull_requests[0].head.ref); + core.exportVariable("PULL_REQUEST_BRANCH_NAME", context.payload.workflow_run.pull_requests[0].head.ref); return; } @@ -43,7 +43,7 @@ runs: core.setFailed(`Unable to determine the pull request number and branch name for event "${context.eventName}"`); - name: "Add label to pull request based on branch name" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | diff --git a/actions/github/pull-request/approve/action.yaml b/actions/github/pull-request/approve/action.yaml index 82f295f..1706036 100644 --- a/actions/github/pull-request/approve/action.yaml +++ b/actions/github/pull-request/approve/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/pulls#create-a-review-for-a-pull-request +# https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run @@ -19,7 +19,7 @@ runs: steps: - name: "Determine pull request number" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | @@ -41,7 +41,7 @@ runs: core.setFailed(`Unable to determine the pull request number for event "${context.eventName}"`); - name: "Approve pull request" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | diff --git a/actions/github/pull-request/merge/action.yaml b/actions/github/pull-request/merge/action.yaml index 0a96a09..c919bd8 100644 --- a/actions/github/pull-request/merge/action.yaml +++ b/actions/github/pull-request/merge/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/pulls#merge-a-pull-request +# https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run @@ -23,7 +23,7 @@ runs: steps: - name: "Determine pull request number" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v7.0.1" with: github-token: "${{ inputs.github-token }}" script: | @@ -45,7 +45,7 @@ runs: core.setFailed(`Unable to determine the pull request number for event "${context.eventName}"`); - name: "Merge pull request" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v7.0.1" env: MERGE_METHOD: "${{ inputs.merge-method }}" with: diff --git a/actions/github/pull-request/request-review/action.yaml b/actions/github/pull-request/request-review/action.yaml index cf613c3..e134fb8 100644 --- a/actions/github/pull-request/request-review/action.yaml +++ b/actions/github/pull-request/request-review/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/pulls#request-reviewers-for-a-pull-request +# https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run @@ -22,7 +22,7 @@ runs: steps: - name: "Determine pull request number" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | @@ -44,7 +44,7 @@ runs: core.setFailed(`Unable to determine the pull request number for event "${context.eventName}"`); - name: "Request reviewer" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" env: REVIEWER: "${{ inputs.reviewer }}" with: diff --git a/actions/github/release/create/action.yaml b/actions/github/release/create/action.yaml index 76a0ca8..1c90e25 100644 --- a/actions/github/release/create/action.yaml +++ b/actions/github/release/create/action.yaml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/creating-actions/creating-a-composite-action # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions -# https://docs.github.com/en/rest/reference/releases#create-a-release +# https://docs.github.com/en/rest/releases/releases#create-a-release # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push name: "Create a release" @@ -9,6 +9,10 @@ name: "Create a release" description: "Creates a release" inputs: + draft: + description: "Whether to create a draft or a published release" + required: false + default: "false" github-token: description: "GitHub token of a user with permission to create a release" required: true @@ -23,7 +27,7 @@ runs: shell: "bash" - name: "Create release" - uses: "actions/github-script@v6.3.1" + uses: "actions/github-script@v8.0.0" with: github-token: "${{ inputs.github-token }}" script: | @@ -35,7 +39,7 @@ runs: try { const response = await github.rest.repos.createRelease({ - draft: false, + draft: ${{ fromJSON(inputs.draft) }}, generate_release_notes: true, name: process.env.RELEASE_TAG, owner: context.repo.owner, @@ -44,6 +48,7 @@ runs: tag_name: process.env.RELEASE_TAG, }); + core.exportVariable('RELEASE_HTML_URL', response.data.html_url); core.exportVariable('RELEASE_ID', response.data.id); core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); } catch (error) { diff --git a/actions/github/release/publish/action.yaml b/actions/github/release/publish/action.yaml new file mode 100644 index 0000000..f9615b3 --- /dev/null +++ b/actions/github/release/publish/action.yaml @@ -0,0 +1,37 @@ +# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions +# https://docs.github.com/en/rest/releases/releases#update-a-release +# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push + +name: "Publish a release" + +description: "Publishes a release" + +inputs: + github-token: + description: "GitHub token of a user with permission to publish a release" + required: true + release-id: + description: "The release identifier" + required: true + +runs: + using: "composite" + + steps: + - name: "Publish release" + uses: "actions/github-script@v7.0.1" + with: + github-token: "${{ inputs.github-token }}" + script: | + try { + const response = await github.rest.repos.updateRelease({ + draft: false, + owner: context.repo.owner, + release_id: ${{ inputs.release-id }}, + repo: context.repo.repo, + }); + } catch (error) { + core.setFailed(error.message); + } diff --git a/actions/oh-dear/check/request-run/action.yaml b/actions/oh-dear/check/request-run/action.yaml new file mode 100644 index 0000000..7ad7509 --- /dev/null +++ b/actions/oh-dear/check/request-run/action.yaml @@ -0,0 +1,28 @@ +# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions +# https://ohdear.app/docs/integrations/api/checks#enable-amp-disable-a-check + +name: "Request a check run" + +description: "Request a check run" + +inputs: + oh-dear-api-token: + description: "Oh Dear API token of a user with permission to request a check run" + required: true + oh-dear-check-id: + description: "Check identifer of an Oh Dear check for which to request a run" + required: true + +runs: + using: "composite" + + steps: + - name: "Request a check run on ohdear.app" + run: | + curl -X POST "https://ohdear.app/api/checks/${{ inputs.oh-dear-check-id }}/request-run" \ + -H "Authorization: Bearer ${{ inputs.oh-dear-api-token }}" \ + -H "Accept: application/json" \ + -H "Content-Type: application/json" + shell: "bash" diff --git a/actions/phive/install/action.yaml b/actions/phive/install/action.yaml new file mode 100644 index 0000000..2261c0c --- /dev/null +++ b/actions/phive/install/action.yaml @@ -0,0 +1,39 @@ +# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions +# https://phar.io + +name: "Install dependencies with phive" + +description: "Installs dependencies with phive" + +inputs: + phive-home: + default: ".build/phive" + description: "Which directory to use as PHIVE_HOME directory" + required: false + trust-gpg-keys: + default: "" + description: "A comma-separated list of trusted GPG keys" + required: true + +runs: + using: "composite" + + steps: + - name: "Create phive home directory" + run: "mkdir -p ${{ inputs.phive-home }}" + shell: "bash" + + - name: "Cache dependencies installed with phive" + uses: "actions/cache@v4.3.0" + with: + path: "${{ inputs.phive-home }}" + key: "phive-${{ hashFiles('**/phars.xml') }}" + restore-keys: "phive-" + + - name: "Install dependencies with phive" + env: + PHIVE_HOME: "${{ inputs.phive-home }}" + run: "phive install --trust-gpg-keys ${{ inputs.trust-gpg-keys }}" + shell: "bash" diff --git a/profile/README.md b/profile/README.md index 48fe6b3..c4c419c 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1,5 +1 @@ :wave: - -Do you like what you see? - -Consider [sponsoring @localheinz](https://github.com/sponsors/localheinz), who maintains these fine packages!