Skip to content

Commit

Permalink
Merge pull request #48 from piotrnarajowski/test_cron1
Browse files Browse the repository at this point in the history
test cron 1
  • Loading branch information
piotrnarajowski authored Jul 22, 2024
2 parents 4b3c00c + da278c3 commit 15fb795
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/check_for_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ def main():
if len(sys.argv) > 1:
commit = sys.argv[1]
else:
commit = "HEAD"
commit = 'HEAD'
if len(sys.argv) > 2:
upstream = sys.argv[2]
else:
upstream = "origin/master"
upstream = 'origin/master'
mb = run_cmd(f"git merge-base {upstream} {commit}")
upstream = mb[0]

base_ref = os.environ.get('GITHUB_BASE_REF')
head_ref = os.environ.get('GITHUB_HEAD_REF')

result = subprocess.run(
['git', 'diff', '--name-only', 'origin/master', base_ref, '--', 'autopts/wid/'],
['git', 'diff', '--name-only', upstream, commit, '--', 'autopts/wid/'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True
)

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_cron_from_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: check_changes
run: |
python .github/check_for_changes.py
if [ changed_files_formatted.txt ]; then
if [ -s changed_files_formatted.txt ]; then
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 15fb795

Please sign in to comment.