Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,45 @@

on:
push:
branches:
- master
branches: [master]
pull_request_target:
branches: [master]
types: [opened, synchronize, reopened]

jobs:
decide-if-trusted:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check.outputs.ok }}
steps:
- name: Trust gate
id: check
run: |
# default to skip
echo "ok=false" >> "$GITHUB_OUTPUT"

# Push events are always safe
if [ "${{ github.event_name }}" = "push" ]; then
echo "ok=true" >> "$GITHUB_OUTPUT"
exit 0
fi

# For PRs, look at the author's relationship
case "${{ github.event.pull_request.author_association }}" in
OWNER|MEMBER|COLLABORATOR|CONTRIBUTOR)
echo "ok=true" >> "$GITHUB_OUTPUT"
;;
esac

integration_tests:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: Run integration tests
needs: decide-if-trusted
if: needs.decide-if-trusted.outputs.ok == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Go

Check failure

Code scanning / CodeQL

Checkout of untrusted code in trusted context High

Potential execution of untrusted code on a privileged workflow (
pull_request_target
)
uses: actions/setup-go@v5
with:
go-version: '1.21'
Expand Down
Loading