-
Notifications
You must be signed in to change notification settings - Fork 16
58 lines (49 loc) · 1.85 KB
/
automatic_chores.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
name: Automatic chores
on:
push:
branches:
- releases/1.10
paths:
- SharePointFramework/**
- .github/workflows/automatic_chores.yml
jobs:
automatic_chores:
name: Automatic chores
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}_automatic_chores
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Rush Lint
run: node common/scripts/install-run-rush.js lint
- name: Add all changes
run: |
git add -A
- name: Get git context
id: git_context
run: |
status=`git status --porcelain`
echo "::set-output name=status::$status"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Commit files as {github-automatic-chores} (if staged changes)
if: ${{ steps.git_context.outputs.status != '' }}
run: |
git config --local user.email "github-automatic-chores@users.noreply.github.com"
git config --local user.name "github-automatic-chores"
git commit --no-verify -m "automatic chores: linting [skip-ci]" \
-m "This is a commit done by the GitHub action https://github.com/Puzzlepart/prosjektportalen365/blob/releases/1.9/.github/workflows/automatic_chores.yml."
- name: Push changes (if staged changes)
if: ${{ steps.git_context.outputs.status != '' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.AUTOMATIC_CHORES_GH_TOKEN }}
branch: ${{ github.ref }}