diff --git a/.github/workflows/generate_README.yaml b/.github/workflows/generate_README.yaml index 30a01f9..6364385 100644 --- a/.github/workflows/generate_README.yaml +++ b/.github/workflows/generate_README.yaml @@ -3,6 +3,8 @@ on: pull_request: paths: - "docs/**/*" +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: make-README: @@ -44,7 +46,7 @@ jobs: git add README.md git update-index --refresh if ! git diff-index --cached --quiet HEAD; then - echo "Committing changes to README.md" + echo "Committing changes to README.md to branch $BRANCH_NAME" git commit -m "Automated update of README.md from docs" - git push origin + git push origin HEAD:$BRANCH_NAME fi diff --git a/.github/workflows/generate_help_docs.yaml b/.github/workflows/generate_help_docs.yaml index bbb1bf1..528e535 100644 --- a/.github/workflows/generate_help_docs.yaml +++ b/.github/workflows/generate_help_docs.yaml @@ -4,6 +4,8 @@ on: paths: - "src/sim_recon/cli/parsing/*" - "src/sim_recon/settings/formatting.py" +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: generate-help-docs: @@ -46,7 +48,7 @@ jobs: git add docs/* git update-index --refresh if ! git diff-index --cached --quiet HEAD; then - echo "Committing changes to help docs" + echo "Committing changes to help docs to branch $BRANCH_NAME" git commit -m "Automated update of help docs" - git push origin + git push origin HEAD:$BRANCH_NAME fi