List the file differences between the current branch commit and the common ancestor with another branch. #2303
Answered
by
jackton1
CustomEntity
asked this question in
Q&A
-
Hello, we have a use case where we need to list the file differences of the current commit branch (After a push/pull-request in any branch) with our “Dev” branch and we'd like to know if it's possible to do this with your action. Currently we're doing a Thanks in advance |
Beta Was this translation helpful? Give feedback.
Answered by
jackton1
Oct 20, 2024
Replies: 1 comment 3 replies
-
Hi @CustomEntity, you can simply use the example provided in the docs name: CI
on:
pull_request:
branches:
- dev
jobs:
# ------------------------------------------------------------------------------------------------------------------------------------------------
# Event `pull_request`: Compare the last commit of the dev branch -> to the current commit of a PR branch.
# ------------------------------------------------------------------------------------------------------------------------------------------------
changed_files:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
jackton1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @CustomEntity, you can simply use the example provided in the docs