-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (40 loc) · 1.14 KB
/
autoformat.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: Autoformat
on:
issue_comment:
types:
- created
jobs:
autoformat:
runs-on: ubuntu-latest
if: github.event.issue.pull_request
steps:
- run: echo ${{ github.head_ref }}
- run: echo ${{ github.base_ref }}
- env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo $GITHUB_CONTEXT
- uses: actions/github-script@v2
id: get-latest-sha
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const resp = await github.pulls.listCommits({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
core.setOutput('sha', resp.data.slice(-1)[0].sha);
- uses: actions/checkout@v2
with:
ref: ${{ steps.get-latest-sha.outputs.sha }}
- run: |
git status
git remote -v
git branch -a
- run: |
date > test.txt
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -s -m "generated"
git push