-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (50 loc) · 1.76 KB
/
pr-autofix.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
# AUTOGENERATED by workflow-preprocessor.js from ../.github/workflow-templates/pr-autofix.yml
name: Autofixers
'on':
- pull_request
jobs:
autofix:
runs-on: ubuntu-latest
if: github.actor != 'khan-actions-bot'
steps:
- uses: actions/checkout@v1
name: '▶️ Setup checkout: get the repo'
- id: paths__github_workflow_templates_
name: 'Check paths: .github/workflow-templates/**'
run: >-
BASE=${GITHUB_BASE_REF:-HEAD~1}
if [[ -n $(git diff --name-only refs/remotes/origin/$BASE --relative |
grep '^\.github/workflow-templates/.*$') ]]
then
echo "::set-output name=changed::true"
exit 0
fi
echo "::set-output name=changed::false"
exit 0
- id: paths_src_
name: 'Check paths: src/**'
run: >-
BASE=${GITHUB_BASE_REF:-HEAD~1}
if [[ -n $(git diff --name-only refs/remotes/origin/$BASE --relative |
grep '^src/.*$') ]]
then
echo "::set-output name=changed::true"
exit 0
fi
echo "::set-output name=changed::false"
exit 0
- run: yarn
name: '▶️ Setup yarn: '
- name: Rebuild github actions workflow
run: yarn make-workflows
if: steps.paths__github_workflow_templates_.outputs.changed == 'true'
- name: Run prettier
run: >-
node ./node_modules/actions-utils/list-changed-files.js | grep
'.*\.js$' | xargs npm run -s format-files
- name: Rebuild our "dist" file
run: yarn build
if: steps.paths_src_.outputs.changed == 'true'
- uses: Khan/autofix-commit-action@master
env:
GITHUB_TOKEN: '${{ secrets.KHAN_ACTIONS_BOT_TOKEN }}'