-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.2 KB
/
checking-repository-code.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
name: Checking Repository Code
on: [push]
jobs:
Checking-Repository-Code:
runs-on: ubuntu-latest
environment: Testing
env:
XXX: ${{ vars.XXX }}
steps:
- name: Environment Variables
run: |
echo "XXX: ${{ env.XXX }}"
- name: Checkout repository code
uses: actions/checkout@v4
- name: Build Package
run: npm run install-build:production
- name: Testing code
run: npm run test-coverage:complete
- name: Prettier-linting code
run: npm run prettier-lint
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check for changes
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.changes == 'true'
run: |
git add .
git commit --amend --no-edit
git push --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}