From 330e013e619842633de5372567874d86894235fc Mon Sep 17 00:00:00 2001 From: jon r Date: Tue, 2 Jan 2024 16:26:32 +0100 Subject: [PATCH] feat(release): update downstream This adds an update-downstream job which dispatches the increase-base-version workflow in the wiki-oci-distribution repository to sync the base version. This is largely based on: * https://github.com/actions/github-script/issues/250 * https://github.blog/changelog/2022-09-08-github-actions-use-github_token-with-workflow_dispatch-and-repository_dispatch/ --- .github/workflows/release-increased-version.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/release-increased-version.yml b/.github/workflows/release-increased-version.yml index e08802f..0519981 100644 --- a/.github/workflows/release-increased-version.yml +++ b/.github/workflows/release-increased-version.yml @@ -58,3 +58,20 @@ jobs: with: ref: "refs/tags/v${{ needs.tag-release.outputs.current-version }}" secrets: inherit + + update-downstream: + name: Update downstream distribution + needs: ['call-build-push'] + uses: actions/github-script@v7 + if: needs.tag-release.outputs.previous-version != needs.tag-release.outputs.current-version + with: + script: | + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: 'wiki-oci-distribution', + workflow_id: 'increase-base-version.yml', + ref: 'main', + inputs: + previous-version: "${{ needs.tag-release.outputs.previous-version }}", + next-version: "${{ needs.tag-release.outputs.current-version }}" + })