Skip to content

Commit

Permalink
tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ioluc committed Oct 29, 2024
1 parent d192a8c commit 59df1b9
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,42 @@ jobs:
pip install git+https://github.com/docsible/docsible.git@name-prefix-in-ansible-lint
# Step 4: Run Docsible to generate documentation
- name: Generate documentation for ThermoCore role
- name: Generate documentation for role
run: |
docsible -r ./ -g -o README.md -a -com
# Step 5: Check for changes
- name: Check for documentation changes
run: |
git config --global user.name "exaluc"
git config --global user.email "42606+exaluc@users.noreply.github.com"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
if git diff --exit-code; then
echo "No changes to commit";
exit 0;
fi
# Step 6: Commit and push changes
- name: Commit and push documentation
# Step 6: Commit changes and push to a new branch
- name: Commit and push changes
run: |
# Generate a unique branch name
branch_name="docs-update-$(date +'%Y%m%d%H%M%S')"
git checkout -b "$branch_name"
git commit -m "Automated documentation update by GitHub Actions"
git push origin main
git push origin "$branch_name"
# Step 7: Create a pull request
- name: Create a pull request
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pullRequest } = await github.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Automated Documentation Update",
head: "${{ github.actor }}:${{ steps.commit_and_push.outputs.branch_name }}",
base: "main",
body: "This pull request contains automated documentation updates generated by GitHub Actions."
});
console.log(`Pull request created: ${pullRequest.html_url}`);

0 comments on commit 59df1b9

Please sign in to comment.