Skip to content

Update plan specs (#1554) #798

Update plan specs (#1554)

Update plan specs (#1554) #798

name: Trigger downstream updates
on:
push:
branches:
- main
jobs:
generate-trigger-reason:
name: Generate the trigger reason
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
reason: ${{ steps.reason.outputs.value }}
steps:
# The commit message are multiline. Use a regex to split out
# just the first line, and the PR number into regex groups.
- name: Parse commit message
uses: actions-ecosystem/action-regex-match@v2
id: parse-commit
with:
text: ${{ github.event.head_commit.message }}
regex: '^(.*) \((\#\d*)\)'
# Use the regex above to create a trigger reason that links back to the
# api-definitions repository. For example:
# "commit message (#100)" expands into:
# "commit message Rebilly/api-definitions#100"
- name: Create trigger reason
id: reason
run: echo '::set-output name=value::${{steps.parse-commit.outputs.group1}} Rebilly/api-definitions${{steps.parse-commit.outputs.group2}}'
trigger-recomm-update:
name: Trigger Recomm update
runs-on: ubuntu-latest
needs: generate-trigger-reason
steps:
- name: Wait for Redocly to publish combined bundle
uses: Sibz/[email protected]
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
# Which status checks to wait for. We only care about the combined bundle.
contexts: 'Redocly Registry (combined/combined) bundle'
# How long to wait for the Redocly status to be posted, in seconds
timeout: 600
notPresentTimeout: 600
- name: Trigger update workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: FE/api-metadata/Update resources from API definitions
ref: main
repo: Rebilly/rebilly
token: ${{ secrets.MACHINE_USER_PAT }}
inputs: '{ "trigger-reason": "${{needs.generate-trigger-reason.outputs.reason}}" }'
trigger-rebilly-js-sdk-update:
name: Trigger JS SDK update
runs-on: ubuntu-latest
needs: generate-trigger-reason
steps:
- name: Trigger update workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: FE/Rebilly JS SDK/Updates JS SDK resources based on api-definitions
ref: main
repo: Rebilly/rebilly
token: ${{ secrets.MACHINE_USER_PAT }}
inputs: '{ "trigger-reason": "${{needs.generate-trigger-reason.outputs.reason}}" }'
trigger-rebilly-php-sdk-update:
name: Trigger PHP SDK update
runs-on: ubuntu-latest
needs: generate-trigger-reason
steps:
- name: Trigger update workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Updates SDK based on api-definitions
ref: v3.x
repo: Rebilly/rebilly-php
token: ${{ secrets.MACHINE_USER_PAT }}
inputs: '{ "trigger-reason": "${{needs.generate-trigger-reason.outputs.reason}}" }'