Skip to content

Commit

Permalink
Skip veristat validation with Meta objects for PRs from forks
Browse files Browse the repository at this point in the history
Github actions doesn't allow to access both variable and secrets for
workflows triggered by pull requests from forked repositories.

Disabling veristat validation with Meta objects for such PRs since
workflow won't be able to download objects due to missing secrets.

Signed-off-by: Nikolay Yurin <[email protected]>
  • Loading branch information
yurinnick committed Oct 5, 2023
1 parent eed581e commit 67e432f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,18 @@ jobs:
image-output: '/tmp/root.img'

- name: Configure AWS Credentials
# Disabling BPF objects download and veristat-meta benchmark for PRs
# created from fork repositories. These won't have access to required
# enviroment variables and secrets, and otherwise would consistently fail
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-action-bpf-ci

- name: Download BPF objects
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: |
set -eux
if [ -n "$AWS_ROLE_ARN" ]; then
Expand All @@ -226,6 +231,7 @@ jobs:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}

- name: Add BPF objects to rootfs
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
shell: bash
run: ./.github/scripts/bpf-objects-rootfs.sh

Expand All @@ -247,6 +253,7 @@ jobs:
baseline_name: ${{ env.ARCH_AND_TOOL}}-baseline-veristat-kernel

- name: Compare and save veristat.meta.csv
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: ./.github/actions/veristat_baseline_compare
with:
veristat_output: veristat-meta
Expand Down

0 comments on commit 67e432f

Please sign in to comment.