New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Get all changes on current branch against a base_sha #599
Comments
Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience. |
@boranliu By default using on:
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v29.0.0
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done The diff is based on the last commit SHA on the Target branch of the pull request and the current pushed commit SHA of the current branch Can you elaborate on the difference in your use case? |
Thanks for the quick response. My use case is for on push event and one example can be illustrated as below:
So I would like to get all changes files on the current branch B against branch A (essentially sha 123) for every new push (which means that not only from the current commit that I pushed, but all the commits pushed earlier). Right now the behavior I spotted is that diff is only calculated between each new commit I pushed on branch B and the commit with sha 123 (from branch A). One example could be:
Now the expected behavior I am trying to achieve is that for the second commit, |
@boranliu In that case I'll suggest using - name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v29.0.1
with:
base_sha: ${{ github.event.pull_request.base.sha }}
|
Is this feature missing in the latest version?
Is your feature request related to a problem? Please describe.
Currently I am trying to get all the modified files from a PR when I push a single commit (with potentially multiple commits pushed earlier), and would like to see all modified files (including all modified files from previously pushed commits) against a different base_sha other than the last commit from the same remote branch.
This should be similar to
since_last_remote_commit
but with the ability to input a base_sha.Use case for this will be something like branching out from a base branch and trying to check all modified files from the current branch to the base branch (with multiple commits pushed to a PR)
Describe the solution you'd like?
The ability to list all changed files in all commits in current branch that triggers the actions against another branch (base_sha)
Describe alternatives you've considered?
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: