Skip to content

Commit

Permalink
DROP: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Sep 5, 2024
1 parent af1b984 commit ea6e830
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ jobs:
image: openjdk:8-jdk
steps:
- uses: actions/checkout@v4

- name: Install GitHub CLI
run: |
curl -sSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor | tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt update
apt install -y gh
- name: Get PR branch name
id: get-pr-branch
run: |
if [[ $GITHUB_REF == refs/pull/* ]]; then
PR_BRANCH=$(gh pr view ${GITHUB_REF#refs/pull/} --json headRefName -q .headRefName)
echo "GITHUB_PR_BRANCH=${PR_BRANCH}" >> $GITHUB_ENV
else
BRANCH_NAME=${GITHUB_REF#refs/heads/}
echo "GITHUB_PR_BRANCH=${BRANCH_NAME}" >> $GITHUB_ENV
fi
echo "GITHUB_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup System Tools
run: |
apt update -y
Expand Down
13 changes: 11 additions & 2 deletions rskj-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ spotless {
}
}


def getFilteredFiles() {
def timestamp = ext.timestamp

def branchName = System.getenv('GITHUB_PR_BRANCH') ?: 'master'
def commitSHA = System.getenv('GITHUB_SHA') ?: 'latest'

println "Branch Name: ${branchName}"
println "Commit SHA: ${commitSHA}"

def commandLog = [
'git', 'log', '--since=' + timestamp, '--name-only', '--pretty=format:', '--abbrev-commit'
'git', 'log', '--since=2024-09-03T02:17:00', '--name-only', '--pretty=format:'
]
def commandDiff = [
'git', 'diff', '--name-only'
Expand Down Expand Up @@ -73,6 +78,10 @@ def getFilteredFiles() {
def uncommittedFiles = outputDiff.toString().trim().split('\n').toList().unique()
def stagedFiles = outputStaged.toString().trim().split('\n').toList().unique()

println "Committed files (Git log output): ${committedFiles}"
println "Uncommitted files (Git diff output): ${uncommittedFiles}"
println "Staged files (Git diff --cached output): ${stagedFiles}"

def allFiles = committedFiles + uncommittedFiles + stagedFiles
allFiles = allFiles.unique().findAll { file -> file }

Expand Down

0 comments on commit ea6e830

Please sign in to comment.