-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (41 loc) · 1.46 KB
/
icon-regression-update.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
name: Icon-regression-Update
on:
issue_comment:
types: [created, edited]
jobs:
update_regression:
if: contains(github.event.comment.html_url, '/pull/') && contains(github.event.comment.body, '[update regression]')
runs-on: ubuntu-latest
name: Regression test
steps:
- uses: actions/github-script@v3
id: get-pr
with:
script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.pulls.get(request)
return result.data
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
- name: Regression Test Update
run: yarn test:regression:docker:update
- uses: EndBug/add-and-commit@v5
with:
add: './packages/natds-icons/regression/__image_snapshots__'
author_name: Design System via github action
author_email: [email protected]
message: 'chore: updating icons regression test reference image [skip ci]'
branch: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}