Skip to content

Commit

Permalink
Workflow fix (#26)
Browse files Browse the repository at this point in the history
* Update global github user

* update files and improve worklflow

* update workflow for the 8071234 time
  • Loading branch information
thefourcraft authored Sep 12, 2023
1 parent 4c55cd3 commit fa2aa95
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/create_docusaurus_page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [labeled]

jobs:
create-docusaurus-page:
create-branch:
runs-on: ubuntu-latest
if: github.event.label.name == 'new-page'
steps:
Expand All @@ -19,14 +19,32 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Create Branch
- name: Create and Push Branch
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
BRANCH_NAME="new-page-${ISSUE_NUMBER}"
git checkout -b $BRANCH_NAME
git commit --allow-empty -m "Initial empty commit"
git push -u origin $BRANCH_NAME
commit-file:
needs: create-branch
runs-on: ubuntu-latest
if: github.event.label.name == 'new-page'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: Production
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout New Branch
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
BRANCH_NAME="new-page-${ISSUE_NUMBER}"
git checkout $BRANCH_NAME
- name: Create Docusaurus File
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
Expand All @@ -43,10 +61,6 @@ jobs:
echo "---" >> $FILENAME
echo "$CONTENT" >> $FILENAME
git add $FILENAME
git commit -m "Create new Docusaurus page from issue $ISSUE_NUMBER"
git push origin $BRANCH_NAME
- name: Add, Commit and Push Changes
run: |
git add .
Expand Down

0 comments on commit fa2aa95

Please sign in to comment.