-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (35 loc) · 1.31 KB
/
fixtures.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
name: Trigger Fixture Regeneration
on:
pull_request:
types:
- labeled
jobs:
trigger_pipeline:
if: github.event.label.name == 'regenerate-fixtures'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.22.x
- name: Regenerate Fixtures
run: CODECRAFTERS_RECORD_FIXTURES=true make test
- name: Update Fixtures
run: |
git config --global user.email "[email protected]"
git config --global user.name "Ryan Gang"
git remote set-url origin https://ryan-gang:${{ secrets.GITHUB_TOKEN }}@github.com/codecrafters-io/shell-tester.git
git diff --quiet || (git add . && git commit -m "ci: add regenerated fixtures" && git push)
- uses: actions-ecosystem/action-create-comment@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: |
Triggered a [Github Actions](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) job to update fixtures.
- uses: actions-ecosystem/action-remove-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: regenerate-fixtures