forked from aws/karpenter-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (38 loc) · 1.49 KB
/
e2e-matrix-trigger.yaml
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
name: E2EMatrixTrigger
on:
schedule:
- cron: '7 */8 * * *'
push:
branches: [main]
workflow_run:
workflows: [ApprovalComment]
types: [completed]
workflow_dispatch:
jobs:
resolve-git-ref:
if: (github.repository == 'aws/karpenter' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
outputs:
GIT_REF: ${{ steps.resolve-step.outputs.GIT_REF }}
steps:
# Download the artifact and resolve the commit if initiated by PR snapshot
# Otherwise, use the currently checked-out branch to run the E2E tests against
- uses: actions/checkout@v3
- if: github.event_name == 'workflow_run'
uses: ./.github/actions/download-artifact
- id: resolve-step
run: |
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
echo GIT_REF=$(tail -n 1 /tmp/artifacts/metadata.txt) >> $GITHUB_OUTPUT
else
echo GIT_REF="" >> $GITHUB_OUTPUT
fi
e2e-matrix:
needs: [resolve-git-ref]
if: (github.repository == 'aws/karpenter' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')) || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/e2e-matrix.yaml
with:
event_name: ${{ github.event_name }}
git_ref: ${{ needs.resolve-git-ref.outputs.GIT_REF }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}