Skip to content

Commit

Permalink
Detect new files, extract ref, add package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
einarsi committed Feb 21, 2024
1 parent 985f38f commit 7e50479
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/update-septic-docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,30 @@ jobs:
- name: Look for documentation changes
id: checkfiles
run: |
# Ensure any new files are added before checking for changes
git add public/
# --quiet does apparently not imply --exit-code as git doc claims
echo "changed=$(git diff --exit-code public ':!**/meta.yaml' >/dev/null; echo $?)" >> $GITHUB_OUTPUT
echo "changed=$(git diff HEAD --exit-code public ':!**/meta.yaml' >/dev/null; echo $?)" >> $GITHUB_OUTPUT
- name: Extract ref name
if: ${{ steps.checkfiles.outputs.changed != 0 }}
run: |
ref=$(echo ${{ github.event.client_payload.ref }} | cut -d'/' -f3)
if [ "$ref" = "main" ]; then
ref="latest"
fi
echo "REF=$ref" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
if: ${{ steps.checkfiles.outputs.changed != 0 }}
with:
add-paths: public/*
add-paths: |
public/*
package.json
labels: "documentation"
branch: "septic-documentation-branch"
title: "docs: update SEPTIC documentation"
branch: "septic-documentation-${{ env.REF }}"
title: "docs: update SEPTIC documentation for ${{ env.REF }}"
commit-message: "Autogenerated from SEPTIC repository"
delete-branch: true
body: |
Expand Down

0 comments on commit 7e50479

Please sign in to comment.