SQL import failed to push due to github branch protection. Seems this will allow the actual supplied token to be used which has push access. The solution was found from https://github.community/t5/GitHub-Actions/Push-to-restricted-master-branch/m-p/54948
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
name: import-pending-sql
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
import-pending-sql:
|
|
strategy:
|
|
fail-fast: false
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Extract branch name
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
id: extract_branch
|
|
- name: Import and commit pending sql
|
|
run: |
|
|
git config user.email "azerothcorebot@gmail.com" && git config user.name "AzerothCoreBot"
|
|
cd bin/
|
|
source acore-db-pendings
|
|
cd ..
|
|
git fetch --unshallow origin ${BRANCH}
|
|
git add -A .
|
|
git commit -am "Import pending SQL update file..." -m "Referenced commit(s):${GITHUB_SHA}" || true
|
|
env:
|
|
BRANCH: ${{ steps.extract_branch.outputs.branch }}
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@fe38f0a751bf9149f0270cc1fe20bf9156854365
|
|
with:
|
|
github_token: ${{ secrets.AC_GITHUB_TOKEN }}
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|