Skip to content

Commit

Permalink
Don't run CI github actions that commit/push on forks
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-shelkovnikov committed Jan 10, 2025
1 parent e9a6739 commit 83d0996
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .buildkite/run_linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source .buildkite/publish/git-setup.sh

init_python

if is_pr; then
if is_pr && ! is_fork; then
echo "We're on PR, running autoformat"
if ! make autoformat ; then
echo "make autoformat ran with errors, exiting"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/run_notice_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -z "$(git status --porcelain | grep NOTICE.txt)" ]; then
exit 0
else
git --no-pager diff
if is_pr; then
if is_pr && ! is_fork; then
export GH_TOKEN="$VAULT_GITHUB_TOKEN"

git add NOTICE.txt
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ is_pr() {
return 0 # true
fi
}

is_fork() {
if [ "BUILDKITE_PULL_REQUEST_REPO" = "https://github.com/elastic/connectors.git"]; then
return 1 # false
else
return 0 # true
fi
}

0 comments on commit 83d0996

Please sign in to comment.