-
Notifications
You must be signed in to change notification settings - Fork 255
97 lines (87 loc) · 3.41 KB
/
developer-portal-healthckeck.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Healthcheck
on: push
jobs:
trigger-healthckeck:
runs-on: ubuntu-latest
steps:
# - uses: ouzi-dev/commit-status-updater@v2
# with:
# status: "pending"
# - name: Set Status to Pending
# run: |
# cat $GITHUB_EVENT_PATH
#
# PR_URL=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq -r .url)
# SHA=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH")
#
# curl -X POST \
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# "$PR_URL/statuses/$SHA" \
# -d '{"state": "pending", "description": "Workflow is in progress", "context": "ci/pending-status"}'
- name: Checkout Repository
uses: actions/checkout@v2
- name: Create Check
run: |
npm i @octokit/rest
node .github/scripts/create-check.js
node .github/scripts/trigger-workflow.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
DEV_HUB_BRANCH: ${{ github.ref_name }}
DEV_HUB_REPO: ${{ github.repository }}
DEV_HUB_SHA: ${{ github.sha }}
# - name: Trigger DevHub healthcheck
# uses: octokit/[email protected]
# with:
# route: POST /repos/shopware/developer-portal/actions/workflows/external-healthcheck.yml@DX-healthcheck/dispatches
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DEV_HUB_BRANCH: ${{ github.ref_name }}
# DEV_HUB_REPO: ${{ github.repository }}
# DEV_HUB_SHA: ${{ github.sha }}
# Create check run
# - name: Create Check
# uses: octokit/[email protected]
# with:
# route: POST /repos/:owner/:repo/check-runs
# owner: ${{ github.repository_owner }}
# repo: ${{ github.repository }}
# name: 'YourCheckName'
# head_sha: ${{ github.sha }}
# status: 'in_progress'
# started_at: ${{ github.event.head_commit.timestamp }}
# output: |
# {
# "title": "Your Check Title",
# "summary": "Your Check Summary"
# }
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Set Check Status to Pending
# uses: actions/github-script@v6
# with:
# script: |
# github.checks.create({
# owner: context.repo.owner,
# repo: context.repo.repo,
# name: 'DevHub healthcheck',
# head_sha: context.sha,
# status: 'in_progress',
# started_at: new Date().toISOString(),
# conclusion: 'neutral',
# completed_at: new Date().toISOString(),
# output: {
# title: 'Setting Check Status to Pending',
# summary: 'Your summary here'
# }
# })
# - name: Set Workflow Status
# run: echo "##[set-output name=status]pending"
# run: echo "status=pending" >> $GITHUB_OUTPUT
# uses: shopware/developer-portal/.github/workflows/self-trigger.yml@DX-healthcheck
# with:
# branch: ${{ github.ref_name }}
# repository: ${{ github.repository }}
# secrets:
# access_token: ${{ secrets.DEVELOPER_PORTAL_WORKFLOW_TOKEN }}