generated from cloudposse/github-actions-workflows-docker-ecr-eks-helmfile
-
-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (63 loc) · 2.13 KB
/
feature-branch.yml
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: |-
Feature Branch (Pull Request) Workflow of a Terraform Module
### Usage
In your repo create __`.github/workflows/feature-branch.yml`__
```yaml
name: feature-branch
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
pull-requests: write
id-token: write
contents: read
jobs:
terraform-module:
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/feature-branch.yml@main
secrets:
github_access_token: $\{\{ secrets.REPO_ACCESS_TOKEN \}\}
```
on:
workflow_call:
inputs:
runs-on:
description: "Overrides job runs-on setting (json-encoded list)"
type: string
required: false
default: '["ubuntu-latest"]'
secrets:
REPO_ACCESS_TOKEN:
description: "GitHub API token"
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
ci-terraform:
uses: cloudposse/github-actions-workflows/.github/workflows/ci-terraform.yml@main
with:
# Workaround for https://github.com/community/community/discussions/9099
# We should switch to nofilter once it's fixed
filter-mode: diff_context
suggestions: true
runs-on: ${{ inputs.runs-on }}
ci-codeowners:
uses: cloudposse/github-actions-workflows/.github/workflows/ci-codeowners.yml@main
with:
is_fork: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ${{ inputs.runs-on }}
secrets:
github_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}
ci-labels:
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: cloudposse/github-action-release-label-validator@v1
ci:
runs-on: ${{ fromJSON(inputs.runs-on) }}
if: ${{ always() }}
steps:
- run: |
echo '${{ toJSON(needs) }}' # easier debug
! ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
needs: [ ci-terraform, ci-codeowners, ci-labels ]