Consolidate shared workflows #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Shared github action workflow" | ||
``` | ||
on: | ||
workflow_call: | ||
inputs: | ||
organization: | ||
description: "Repository owner organization (ex. acme for repo acme/example)" | ||
required: false | ||
default: ${{ github.event.repository.owner.login }} | ||
type: string | ||
repository: | ||
description: "Repository name (ex. example for repo acme/example)" | ||
required: false | ||
default: ${{ github.event.repository.name }} | ||
type: string | ||
ref: | ||
description: "The fully-formed ref of the branch or tag that triggered the workflow run" | ||
required: false | ||
default: ${{ github.ref }} | ||
type: string | ||
tests-prefix: | ||
description: "Workflows file name prefix to run as tests" | ||
required: false | ||
type: string | ||
default: 'test-*' | ||
publish: | ||
description: "Whether to publish a new release immediately" | ||
required: false | ||
default: "true" | ||
type: string | ||
runs-on: | ||
description: "Overrides job runs-on setting (json-encoded list)" | ||
type: string | ||
required: false | ||
default: '["ubuntu-latest"]' | ||
permissions: | ||
contents: write | ||
actions: write | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
jobs: | ||
ci-readme: | ||
uses: cloudposse/github-actions-workflows/.github/workflows/ci-readme.yml@main | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
filter-mode: nofilter | ||
suggestions: false | ||
runs-on: ${{ inputs.runs-on }} | ||
secrets: inherit | ||
ci-gha: | ||
uses: cloudposse/github-actions-workflows/.github/workflows/ci-github-action.yml@main | ||
with: | ||
organization: ${{ inputs.organization }} | ||
repository: ${{ inputs.repository }} | ||
ref: ${{ inputs.ref }} | ||
tests-prefix: ${{ inputs.tests-prefix }} | ||
ci: | ||
runs-on: ${{ fromJSON(inputs.runs-on) }} | ||
if: ${{ always() }} | ||
steps: | ||
- run: | | ||
echo '${{ toJSON(needs) }}' # easier debug | ||
! ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | ||
needs: [ ci-gha, ci-readme ] | ||
release: | ||
needs: [ ci ] | ||
if: ${{ github.event_name == 'push' }} | ||
uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@main | ||
with: | ||
publish: ${{ inputs.publish }} | ||
secrets: inherit |