Skip to content

Commit

Permalink
fix(push-workflows): Configure git early in wf
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Feb 21, 2024
1 parent f7a195d commit 8688409
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Configure git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -42,9 +48,6 @@ jobs:

- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
git add man/\* NAMESPACE DESCRIPTION
git commit -m "docs: update documentation" || echo "No changes to commit"
git remote set-url origin https://$GITHUB_ACTOR:${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY.git
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Configure git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
- name: Setup Node.Js
uses: actions/setup-node@v4

Expand Down Expand Up @@ -56,9 +62,6 @@ jobs:

- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
git commit README.md -m 'docs(README): Re-build README.Rmd' || echo "No changes to commit"
git remote set-url origin https://$GITHUB_ACTOR:${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY.git
git push origin ${{ inputs.branch_name }}
9 changes: 6 additions & 3 deletions .github/workflows/update-lockfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Configure git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -41,9 +47,6 @@ jobs:

- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git switch ${{ inputs.branch_name }}
git add pak.lock
git commit -m "chore: Update pak.lock" || echo "No changes to commit"
git remote set-url origin https://$GITHUB_ACTOR:${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY.git
Expand Down

0 comments on commit 8688409

Please sign in to comment.