Skip to content

Commit

Permalink
try aggressive branch autocorrect on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 12, 2024
1 parent 63ccd01 commit a75ac63
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,19 @@ runs:
else
COMMIT_HASH=$(git rev-parse HEAD)
fi
TIMESTAMP=$(git show -s --format=%cI $COMMIT_HASH)
MESSAGE=$(git show -s --format=%s $COMMIT_HASH)
echo "Commit time: $TIMESTAMP"
echo "Commit title: $MESSAGE"
echo "Commit hash: $COMMIT_HASH"
BRANCH_NAME="${{ github.ref_name }}"
PRNUMBER="${{ github.event.pull_request.number }}"
if [ -n "$PRNUMBER" ]; then
BRANCH_NAME="$PRNUMBER/merge"
git fetch upstream pull/$PRNUMBER/head
git checkout FETCH_HEAD
COMMIT_HASH=$(git rev-parse HEAD)
fi
TIMESTAMP=$(git show -s --format=%cI $COMMIT_HASH)
MESSAGE=$(git show -s --format=%s $COMMIT_HASH)
conda activate gha-comfyui-${{ inputs.python_version }}-${{ inputs.torch_version }}
cd ${{ github.action_path }}
Expand Down Expand Up @@ -417,13 +420,16 @@ runs:
} else {
$commit_hash = git rev-parse HEAD
}
$timestamp = git show -s --format=%cI $commit_hash
$message = git show -s --format=%s $commit_hash
$branch_name = "${{ github.ref_name }}"
$pr_number = "${{ github.event.pull_request.number }}"
if ( $pr_number -ne "" ) {
$branch_name = "$pr_number/merge"
git fetch upstream pull/$pr_number/head
git checkout FETCH_HEAD
$commit_hash = git rev-parse HEAD
}
$timestamp = git show -s --format=%cI $commit_hash
$message = git show -s --format=%s $commit_hash
cd $Env:GITHUB_ACTION_PATH
conda activate gha-comfyui-${{ inputs.python_version }}-${{ inputs.torch_version }}
Expand Down

0 comments on commit a75ac63

Please sign in to comment.