generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (50 loc) · 2.18 KB
/
pull-target-e2e.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
name: pull-target-e2e
## NOTE: This workflow uses the GitHub event `pull_request_target`, which uses the base commit instead of the head.
# Therefore, the source for the e2e tests and `make deploy` will be from base.
# Reference(s):
# - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
# - https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
on:
pull_request_target:
branches:
- main
- "release-**"
paths-ignore:
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
jobs:
is-pr-approved:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if PR approved
env:
GH_TOKEN: ${{ github.token }}
PR_URL: https://github.com/kyma-project/eventing-manager/pull/${{ github.event.number }}
run: |
./scripts/is_pr_approved.sh
wait-until-build-succeeds:
runs-on: ubuntu-latest
needs: is-pr-approved
steps:
- name: Wait for the 'pull-eventing-manager-build' job to succeed
id: pull-wait-build
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20
with:
context: "pull-eventing-manager-build"
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests.
timeout: 600000 # 10 minutes in milliseconds
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting)
check_interval: 60000 # 1 minute in milliseconds
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_OWNER: "${{ github.repository_owner }}"
GITHUB_REPO: "eventing-manager"
backend-switching:
needs: wait-until-build-succeeds
uses: "./.github/workflows/e2e-backend-switching-reuseable.yml"
with:
eventing-manager-image: europe-docker.pkg.dev/kyma-project/dev/eventing-manager:PR-${{ github.event.number }}
cluster-name-prefix: "ghem-"
secrets: inherit