From f0a94b29f0cc8582cee9767460c7712a1bb9e0d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 22:02:19 +0000 Subject: [PATCH 1/6] github-actions(deps): bump ergebnis/.github from 1.4.0 to 1.4.1 Bumps ergebnis/.github from 1.4.0 to 1.4.1. --- updated-dependencies: - dependency-name: ergebnis/.github dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/merge.yaml | 8 ++++---- .github/workflows/release.yaml | 2 +- .github/workflows/triage.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index b04ba3b..72bca86 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -24,23 +24,23 @@ jobs: steps: - name: "Request review from @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/request-review@1.4.0" + uses: "ergebnis/.github/actions/github/pull-request/request-review@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" reviewer: "ergebnis-bot" - name: "Assign @ergebnis-bot" - uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.4.0" + uses: "ergebnis/.github/actions/github/pull-request/add-assignee@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" assignee: "ergebnis-bot" - name: "Approve pull request" - uses: "ergebnis/.github/actions/github/pull-request/approve@1.4.0" + uses: "ergebnis/.github/actions/github/pull-request/approve@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" - name: "Merge pull request" - uses: "ergebnis/.github/actions/github/pull-request/merge@1.4.0" + uses: "ergebnis/.github/actions/github/pull-request/merge@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a111c10..b858858 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,6 +15,6 @@ jobs: steps: - name: "Create release" - uses: "ergebnis/.github/actions/github/release/create@1.4.0" + uses: "ergebnis/.github/actions/github/release/create@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml index f79facd..791c1dd 100644 --- a/.github/workflows/triage.yaml +++ b/.github/workflows/triage.yaml @@ -15,6 +15,6 @@ jobs: steps: - name: "Add labels based on branch name" - uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.4.0" + uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.4.1" with: github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" From a270edeab495f809f2987b5a2be034e75967618f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 22:01:00 +0000 Subject: [PATCH 2/6] github-actions(deps): bump actions/checkout from 3.0.0 to 3.0.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.0 to 3.0.1. - [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/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/integrate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 7beb556..11d1786 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.0" + uses: "actions/checkout@v3.0.1" - name: "Lint YAML files" uses: "ibiqlik/action-yamllint@v3.1.0" From bfab365e42779ddcc65416b50b4a4108dc3833f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:06:22 +0000 Subject: [PATCH 3/6] github-actions(deps): bump actions/checkout from 3.0.1 to 3.0.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.1 to 3.0.2. - [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/v3.0.1...v3.0.2) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/integrate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 11d1786..3642c95 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3.0.1" + uses: "actions/checkout@v3.0.2" - name: "Lint YAML files" uses: "ibiqlik/action-yamllint@v3.1.0" From d5fcd64b40ad8b6a1f662bf8bf898c6a07ed2c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 19 May 2022 17:05:25 +0200 Subject: [PATCH 4/6] Fix: Require value for working-directory input --- CHANGELOG.md | 4 ++++ actions/composer/determine-cache-directory/action.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a9d6e2..1865ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`1.4.1...main`][1.4.1...main]. +### Fixed + +- Required a value for the `working-directory` input of the composite action `composer/determine-cache-directory` ([#82]), by [@localheinz] + ## [`1.4.1`][1.4.1] For a full diff see [`1.4.0...1.4.1`][1.4.0...1.4.1]. diff --git a/actions/composer/determine-cache-directory/action.yaml b/actions/composer/determine-cache-directory/action.yaml index d563d86..908af41 100644 --- a/actions/composer/determine-cache-directory/action.yaml +++ b/actions/composer/determine-cache-directory/action.yaml @@ -11,7 +11,7 @@ inputs: working-directory: default: "." description: "Which directory to use as working directory" - required: false + required: true runs: using: "composite" From 45c93e2f3268b6e7c56bc9b294e00b2d90bd49ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 19 May 2022 17:21:55 +0200 Subject: [PATCH 5/6] Fix: Reference --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1865ca6..c5063bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [1.3.1]: https://github.com/ergebnis/.github/releases/tag/1.3.1 [1.3.2]: https://github.com/ergebnis/.github/releases/tag/1.3.2 [1.4.0]: https://github.com/ergebnis/.github/releases/tag/1.4.0 +[1.4.1]: https://github.com/ergebnis/.github/releases/tag/1.4.1 [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 From 58698f569c36181a18c6efba875b3ab22ad45de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 19 May 2022 17:18:37 +0200 Subject: [PATCH 6/6] Enhancement: Add composer/determine-root-version action --- CHANGELOG.md | 15 ++++++++-- .../determine-root-version/action.yaml | 29 +++++++++++++++++++ .../composer/determine-root-version/run.sh | 28 ++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 actions/composer/determine-root-version/action.yaml create mode 100755 actions/composer/determine-root-version/run.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index c5063bc..aa99848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased -For a full diff see [`1.4.1...main`][1.4.1...main]. +For a full diff see [`1.5.0...main`][1.5.0...main]. + +## [`1.5.0`][1.5.0] + +For a full diff see [`1.4.1...1.5.0`][1.4.1...1.5.0]. + +### Added + +- Added composite action `composer/determine-root-version` ([#87]), by [@localheinz] ### Fixed @@ -95,6 +103,7 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [1.3.2]: https://github.com/ergebnis/.github/releases/tag/1.3.2 [1.4.0]: https://github.com/ergebnis/.github/releases/tag/1.4.0 [1.4.1]: https://github.com/ergebnis/.github/releases/tag/1.4.1 +[1.5.0]: https://github.com/ergebnis/.github/releases/tag/1.5.0 [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 @@ -105,7 +114,8 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [1.3.1...1.3.2]: https://github.com/ergebnis/.github/compare/1.3.1...1.3.2 [1.3.2...1.4.0]: https://github.com/ergebnis/.github/compare/1.3.2...1.4.0 [1.4.0...1.4.1]: https://github.com/ergebnis/.github/compare/1.4.0...1.4.1 -[1.4.1...main]: https://github.com/ergebnis/.github/compare/1.4.1...main +[1.4.1...1.5.0]: https://github.com/ergebnis/.github/compare/1.4.1...1.5.0 +[1.5.0...main]: https://github.com/ergebnis/.github/compare/1.5.0...main [#47]: https://github.com/ergebnis/.github/pull/47 [#48]: https://github.com/ergebnis/.github/pull/48 @@ -121,5 +131,6 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. [#79]: https://github.com/ergebnis/.github/pull/79 [#80]: https://github.com/ergebnis/.github/pull/80 [#82]: https://github.com/ergebnis/.github/pull/82 +[#87]: https://github.com/ergebnis/.github/pull/87 [@localheinz]: https://github.com/localheinz diff --git a/actions/composer/determine-root-version/action.yaml b/actions/composer/determine-root-version/action.yaml new file mode 100644 index 0000000..016d19f --- /dev/null +++ b/actions/composer/determine-root-version/action.yaml @@ -0,0 +1,29 @@ +# 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://getcomposer.org/doc/03-cli.md#composer-root-version + +name: "Determine composer root version" + +description: "Determines the composer root version and exports it as COMPOSER_ROOT_VERSION environment variable" + +inputs: + branch: + default: "main" + description: "Name of the branch, e.g. \"main\"" + required: true + working-directory: + default: "." + description: "Which directory to use as working directory" + required: true + +runs: + using: "composite" + + steps: + - name: "Determine composer root version" + env: + COMPOSER_DETERMINE_ROOT_VERSION_BRANCH: "${{ inputs.branch }}" + COMPOSER_DETERMINE_ROOT_VERSION_WORKING_DIRECTORY: "${{ inputs.working-directory }}" + run: "${{ github.action_path }}/run.sh" + shell: "bash" diff --git a/actions/composer/determine-root-version/run.sh b/actions/composer/determine-root-version/run.sh new file mode 100755 index 0000000..0eb7444 --- /dev/null +++ b/actions/composer/determine-root-version/run.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +branch="${COMPOSER_DETERMINE_ROOT_VERSION_BRANCH}" +workingDirectory="${COMPOSER_DETERMINE_ROOT_VERSION_WORKING_DIRECTORY}" + +if [[ ! -d ${workingDirectory} ]]; then + echo "::error::The value for the \"working-directory\" input needs to be an existing directory. The directory \"${workingDirectory}\" does not exist." + + exit 1; +fi + +pathToComposerJsonFile="${COMPOSER_DETERMINE_ROOT_VERSION_WORKING_DIRECTORY}/composer.json" + +if [[ ! -f "${pathToComposerJsonFile}" ]]; then + echo "::error::A composer.json file could not be found in the directory \"${workingDirectory}\"." + + exit 1 +fi + +COMPOSER_ROOT_VERSION=$(jq --arg key "dev-${branch}" --raw-output '.["extra"]["branch-alias"][$key]' "${pathToComposerJsonFile}") + +if [[ null = "${COMPOSER_ROOT_VERSION}" ]]; then + echo "::error:A branch alias has not been defined in \"${pathToComposerJsonFile}\" for branch \"${branch}\"." + + exit 0 +fi + +echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> "${GITHUB_ENV}"