-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(GODIET-73): 👷 change the way to get all commits
- Loading branch information
1 parent
976bb5a
commit 4af8048
Showing
1 changed file
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,24 @@ jobs: | |
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update PR description with commit list | ||
uses: octokit/[email protected] | ||
with: | ||
route: PATCH /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | ||
mediaType: application/vnd.github.v3+json | ||
body: | | ||
${{ github.event.pull_request.body }} | ||
## Lista de commits: | ||
$(git log --pretty=format:"* %s (%h)" ${{ github.event.before }}..${{ github.sha }}) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Add PR base ref | ||
# Fetch the ref of the base branch, just the single commit. | ||
run: git fetch --depth=1 origin +refs/heads/${{github.base_ref}}:refs/remotes/origin/${{github.base_ref}} | ||
- name: Track PR base branch | ||
# Turn the just-fetched ref into a local branch. | ||
run: git branch --track ${{github.base_ref}} origin/${{github.base_ref}} | ||
- name: Fetch commits in-between base and HEAD | ||
# While the ancestor commit between HEAD and the branch base isn't in the local tree | ||
# fetch X more parent commits of the branch base and branch head. | ||
run: | | ||
while [ -z $( git merge-base ${{github.base_ref}} HEAD ) ]; do | ||
git fetch --deepen=10 origin ${{github.base_ref}} HEAD; | ||
done | ||
# Sets the commit SHAs of head and branch base into two environment variables | ||
# that `nx affected` will read from. | ||
- name: Derive SHAs for base and head for `nx affected` commands | ||
uses: nrwl/nx-set-shas@v2 | ||
with: | ||
main-branch-name: ${{github.base_ref}} |