You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the steps in our main.yaml workflow runs a git diff operation to compare GitHub events before and after a change. The output of this git diff command is written to a changed-files.txt file, which is then used in a subsequent step to report modified files.
The file is tools/dotcms-cli/action/.github/workflows/main.yml
The Code that needs the fix looks like this:
- name: Get changes
run: |
git diff --name-only ${{ github.event.before }} ${{ github.event.after }} > changed_files.txt
- name: List changed files
run: |
while IFS= read -r line
do
echo "\"$line\" was changed"
done < changed_files.txt
These two steps are used to list the files that have changed between events.
the proposed fix looks as follows:
- name: Get changes
run: |
git diff --name-only ${{ github.event.before }} ${{ github.event.after }} > changed_files.txt 2>/dev/null || echo -n "" > changed_files.txt
- name: List changed files
run: |
while IFS= read -r line
do
echo "\"$line\" was changed"
done < changed_files.txt
Steps to Reproduce
it isn't clear how this can happen
However
I created an empty repo on GitHub
I cloned the repo locally
Checked out the demo and the git pushed
then pushed the changes with the required workflows
and finally added a .env file
Then when I felt the GHA was ready I added an image under
files/working/en-us/demo.dotcms.com/images/
and git pushed to the remote repo
Then the error came up
Acceptance Criteria
• The git diff step should always find valid commit references.
• If an issue occurs, the step should recover gracefully and proceed without breaking the workflow.
dotCMS Version
current main
Proposed Objective
Technical User Experience
Proposed Priority
Please Select
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
The text was updated successfully, but these errors were encountered:
Parent Issue
#26300
Problem Statement
One of the steps in our main.yaml workflow runs a git diff operation to compare GitHub events before and after a change. The output of this git diff command is written to a changed-files.txt file, which is then used in a subsequent step to report modified files.
The file is tools/dotcms-cli/action/.github/workflows/main.yml
The Code that needs the fix looks like this:
These two steps are used to list the files that have changed between events.
the proposed fix looks as follows:
Steps to Reproduce
it isn't clear how this can happen
However
files/working/en-us/demo.dotcms.com/images/
and git pushed to the remote repo
Then the error came up
Acceptance Criteria
dotCMS Version
current main
Proposed Objective
Technical User Experience
Proposed Priority
Please Select
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
The text was updated successfully, but these errors were encountered: