Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/check_pr_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,40 @@ on:
jobs:
code_checks:
uses: ./.github/workflows/_code_checks.yml

count_commits:
needs: code_checks
runs-on: ubuntu-latest
outputs:
n_commits: ${{ steps.count_commits.outputs.n_commits }}
steps:
- name: checkout current branch
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: count commits from main
id: count_commits
run: |
git fetch
N_COMMITS=$(git rev-list origin/main.. --count)
echo "::set-output name=n_commits::${N_COMMITS}"

add_empty_commit_if_only_one:
needs: count_commits
runs-on: ubuntu-latest
if: ${{ needs.count_commit.outputs.n_commits == '1' }}
steps:
- name: checkout current branch
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: EndBug/add-and-commit@v8
with:
default_author: github_actions
message: 'Add empty commit to force use PR title during squash merge'
commit: --allow-empty
add: '.' # working tree should be clean
push: true
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:

- name: Setup Git
run: |
git config user.name "version_bump"
git config user.email 'bipboup@imabot.com'
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout "${GITHUB_REF:11}"

Expand Down