-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (67 loc) · 2.14 KB
/
Copy pathshared-github-action.yml
File metadata and controls
74 lines (67 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
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/.github/workflows/shared-readme.yml@main
name: "Readme"
if: ${{ github.event_name == 'push' }}
with:
runs-on: ${{ inputs.runs-on }}
secrets: inherit
ci-gha:
uses: cloudposse/.github/.github/workflows/shared-ci-github-action.yml@main
name: "CI"
with:
organization: ${{ inputs.organization }}
repository: ${{ inputs.repository }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.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 ]
name: "Release"
if: ${{ github.event_name == 'push' }}
uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@main
with:
publish: ${{ inputs.publish }}
secrets: inherit