-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (50 loc) · 1.6 KB
/
pre-commit-hook-on-master.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
name: commit-to-registry
on:
# Trigger the workflow on push
# but only for the master branch
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v1
with:
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install rdflib
pip install requests
- name: nofail tests
run: |
nofails=1 outfile=/tmp/reg_test_results python3 -m check_urls
- name: commit and upload to Register
env:
UNAME: ${{ secrets.registeruname }}
TPASS: ${{ secrets.registertpass }}
run: |
git status
git checkout master
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git add ./\*.ttl
if [ -z "$(git status --porcelain)" ];
then echo 'nothing to commit'
else
git commit -am 'Github Action Commit'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push
fi
python3 -m uploadChanges "$UNAME" "$TPASS" /tmp/reg_test_results
- name: Test
run: |
nofails=1 python3 -m check_urls