-
Notifications
You must be signed in to change notification settings - Fork 19
49 lines (47 loc) · 1.74 KB
/
gravity.yml
File metadata and controls
49 lines (47 loc) · 1.74 KB
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
name: Gravity
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
gravity:
name: Run Gravity
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
with:
version: 10
- uses: actions/download-artifact@v8
with:
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}
name: artifacts
path: artifacts
- name: 'Get PR context'
if: >
github.event.workflow_run.event == 'pull_request'
id: pr-context
env:
GH_TOKEN: ${{ github.token }}
PR_TARGET_REPO: ${{ github.repository }}
PR_BRANCH: |-
${{
(github.event.workflow_run.head_repository.owner.login != github.event.workflow_run.repository.owner.login)
&& format('{0}:{1}', github.event.workflow_run.head_repository.owner.login, github.event.workflow_run.head_branch)
|| github.event.workflow_run.head_branch
}}
run: |
gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" \
--json 'number,headRefOid' \
--jq '"number=\(.number)\nhead-sha=\(.headRefOid)"' \
>> $GITHUB_OUTPUT
- run: pnpm dlx @gravityci/cli "artifacts" # keep track of the sizes of both the .crate file as well as the binary
env:
GRAVITY_SHA: ${{ github.event.workflow_run.head_sha }}
GRAVITY_PR_ID: ${{ github.event.workflow_run.event == 'pull_request' && steps.pr-context.outputs.number || '' }}
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}