Workflow for PR.

This commit is contained in:
Viacheslav Kudinov 2021-06-11 15:15:04 +02:00
parent 261741ff44
commit 05084eb806
1 changed files with 30 additions and 2 deletions

View File

@ -3,10 +3,9 @@ name: "Build and test Maven GitHub action"
on: on:
pull_request: pull_request:
branches: [ master ] branches: [ master ]
push:
jobs: jobs:
build: build_and_test:
name: "Set up Maven and validate" name: "Set up Maven and validate"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@ -47,3 +46,32 @@ jobs:
- name: "Validate Maven version" - name: "Validate Maven version"
run: mvn -v | head -1 | grep "${{ matrix.maven_version }}" run: mvn -v | head -1 | grep "${{ matrix.maven_version }}"
build_and_commit:
name: "Set up Maven and validate"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Set Node.js"
uses: actions/setup-node@v1
with:
node-version: 12
- name: "Install"
run: npm install
- name: "Commit files"
run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
git pull github ${GITHUB_REF} --ff-only
git add .
if [ -z "$(git status --porcelain)" ]; then
exit 0
fi
git commit -m "Fix a[href] in Webflow exported html"
git push github HEAD:${GITHUB_REF}