Skip to content

Commit

Permalink
Merge fix for bot git handling
Browse files Browse the repository at this point in the history
Fixes actions/checkout@v2 using the wrong credentials to push formatted and rebased branches.
Additionally uses shallow clones in Github Actions where possible.

Related PR: #853
  • Loading branch information
upsj committed Aug 5, 2021
2 parents 6c5ff35 + c6bedbb commit ebba714
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 16 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/bot-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ jobs:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && github.event.comment.body == 'label!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
- name: Add appropriate labels
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -21,11 +20,10 @@ jobs:
runs-on: ubuntu-18.04
if: github.event.issue.pull_request != '' && github.event.comment.body == 'check-format!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
- name: Check for formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -41,11 +39,11 @@ jobs:
runs-on: ubuntu-18.04
if: github.event.issue.pull_request != '' && github.event.comment.body == 'format!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
persist-credentials: false
- name: Commit formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -60,6 +58,7 @@ jobs:
with:
ref: develop
fetch-depth: 0
persist-credentials: false
- name: Automatic Rebase
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bot-pr-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'OWNER'
steps:
- name: Checkout the latest code
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
- name: Add appropriate labels
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bot-pr-updated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ jobs:
runs-on: ubuntu-18.04
if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'OWNER'
steps:
- name: Checkout the latest code
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
- name: Check for formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/joss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: setup
run: sudo apt-get install texlive-xetex pandoc pandoc-citeproc
- name: info
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
runs-on: [macos-latest]

steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: setup
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
runs-on: [windows-latest]
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: setup
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
name: mingw/${{ matrix.config.name }}
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: Debug over SSH (tmate)
uses: mxschmitt/action-tmate@v3.5
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows-msvc-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
runs-on: [windows-latest]

steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
- name: setup (versioned)
if: matrix.config.version != 'latest'
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows-msvc-ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
name: msvc/${{ matrix.config.name }}
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: Debug over SSH (tmate)
uses: mxschmitt/action-tmate@v3.5
Expand Down

0 comments on commit ebba714

Please sign in to comment.