Skip to content

Commit bb0a948

Browse files
authored
Skip enterprise tests when the PR comes from a fork (#2038)
* Skip enterprise tests when the PR comes from a fork * Fix * Set a comment in the PR and pass enteprise tests as successful * Set action commit instead of version
1 parent 638f2f5 commit bb0a948

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/acc-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,26 @@ jobs:
104104
name: ${{ matrix.version }} - ${{ matrix.type }} - ${{ matrix.subset }}
105105
runs-on: ubuntu-latest
106106
steps:
107+
- name: Check if fork
108+
run: |
109+
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" && "${{ matrix.type }}" == "enterprise" ]]; then
110+
echo "IS_FORK=true" >> $GITHUB_ENV
111+
else
112+
echo "IS_FORK=false" >> $GITHUB_ENV
113+
fi
114+
- name: Comment PR in forks
115+
if: env.IS_FORK == 'true'
116+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
117+
with:
118+
token: ${{ secrets.GITHUB_TOKEN }}
119+
issue-number: ${{ github.event.pull_request.number }}
120+
body: |
121+
⚠️ Enterprise tests skipped for fork PRs.
122+
- name: Skip job if fork
123+
if: env.IS_FORK == 'true'
124+
run: |
125+
echo "Skipping job because PR is from a fork"
126+
exit 0
107127
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
108128
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
109129
with:

0 commit comments

Comments
 (0)