Skip to content

Commit 7f1c18d

Browse files
authored
Merge branch 'main' into ramona_rangeland
2 parents 46d0bec + 2cc41fb commit 7f1c18d

File tree

9 files changed

+23224
-23137
lines changed

9 files changed

+23224
-23137
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Preview catalogue web from data PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, closed]
6+
paths:
7+
- 'algorithm_catalog/**'
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
WEB_REPO: apex-algorithms-catalogue-web
14+
15+
jobs:
16+
notify-catalogue-web:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Generate a token for gh cli
20+
id: generate-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
app-id: ${{ vars.GH_CATALOGUE_APP_ID }}
24+
private-key: ${{ secrets.GH_CATALOGUE_APP_PRIVATE_KEY }}
25+
owner: ${{ github.repository_owner }}
26+
repositories: ${{ env.WEB_REPO }}
27+
- name: Trigger preview pipeline to catalogue web repo
28+
env:
29+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
30+
REPOSITORY_OWNER: ${{ github.repository_owner }}
31+
WEB_REPOSITORY: ${{ env.WEB_REPO }}
32+
EVENT_TYPE: ${{ github.event.action == 'closed' && 'catalogue-pr-closed' || 'catalogue-pr-updated' }}
33+
run: |
34+
pr_number='${{ github.event.pull_request.number }}'
35+
head_ref='${{ github.event.pull_request.head.ref }}'
36+
head_sha='${{ github.event.pull_request.head.sha }}'
37+
head_repo='${{ github.event.pull_request.head.repo.full_name }}'
38+
catalogue_repo='${{ github.repository }}'
39+
40+
gh api repos/$REPOSITORY_OWNER/$WEB_REPOSITORY/dispatches \
41+
-f event_type="$EVENT_TYPE" \
42+
-F client_payload[pr_number]="$pr_number" \
43+
-F client_payload[head_ref]="$head_ref" \
44+
-F client_payload[head_sha]="$head_sha" \
45+
-F client_payload[head_repo]="$head_repo" \
46+
-F client_payload[catalogue_repo]="$catalogue_repo"

0 commit comments

Comments
 (0)