Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfy76700 committed Mar 16, 2024
1 parent 83984c2 commit 29a1a27
Showing 1 changed file with 17 additions and 35 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/merge-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ on:
push:
branches:
- main

- docs
jobs:
generate_doc:
name: Generate the documentation from the JSON Schemas
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ github.token }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
permissions: write-all
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -25,11 +24,6 @@ jobs:
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch

# - name: Create new branch
# run: |
# git fetch
# git checkout merge/${{ github.run_id }}

- name: Install json-schema-for-humans
run: pip install json-schema-for-humans

Expand All @@ -42,30 +36,18 @@ jobs:
generate-schema-doc --config template_name=md_nested ./.schema/manufacturer.json ./_docs/manufacturer.md
generate-schema-doc --config template_name=md_nested ./.schema/category.json ./_docs/category.md
# - name: Commit files
# run: |
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git add *
# if ! git diff-index --quiet HEAD; then
# git commit -m "Update documentation" -a
# fi

# - name: push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: merge/${{ github.run_id }}

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: |
Update documentation
branch: merge/${{ github.run_id }}
- name: Merge Pull Request
uses: peter-evans/enable-pull-request-automerge@v3
- run: git pull
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add *
if ! git diff-index --quiet HEAD; then
git commit -m "Update documentation" -a
fi
- name: push changes
uses: ad-m/github-push-action@master
with:
token: ${{ secrets.PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}

0 comments on commit 29a1a27

Please sign in to comment.