How to get all pushed commit information

I would like to know how to get information of all commits which I pushed.

For example, if I pushed 2 commits like below, can I get information of all pushed commits?

commit xxxxxx
Author: xxxxx <xxxx@xxxx>
Date:   Sat Jun 6 xx:xx:xx 2020 +0900

    Update

commit yyyyy
Author: xxxxx <xxxx@xxxx>
Date:   Fri Jun 5 xx:xx:xx 2020 +0900

    Add

Especially, I would like to get changed files in all pushed commits.

If you’re using actions/checkout@v2 https://github.com/actions/checkout/, it fetches only a single commit by default.

Would setting fetch-depth: 0 to fetch all history for all tags and branches help with what you are trying to achieve?

Thank you for your response.

Can we get how many commits we did?
In my understanding, even if we have all repository logs, if we don’t know how many commits we push, we don’t have any way to get modified files name which we push.

Just what I would like to know is modified files name which we push.
In this case, “push” doesn’t mean all history, that means one push I did at some point.

I don’t mind to use Dockerfile or JavaScript for realizing it.

Hi @nackdai,
Sorry for the delay response.
In push event, before and after key are stand for the previous commit of this push operation and the last commit in this push operation. All the commits related to the push are included between these two commits.

To get the modified files accossiated with the push event, you could use git diff command to get the file names.
git diff --name-only ${{ github.event.before }} ${{ github.event.after }}

Also, remember to set fetch-depth: 0 in checkout action.
Please see my example workflow yml :

on:
  push:
jobs:
   build: 
     runs-on: ubuntu-latest
     steps: 
      - uses: actions/checkout@v2
        with: 
          fetch-depth: 0
      - name: get file changes
        run: | 
          git diff --name-only ${{ github.event.before }} ${{ github.event.after }}