Skip to content

Commit

Permalink
ci: fix workflow trigger conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
necipallef committed Sep 25, 2024
1 parent 49be83d commit 0e1f9cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/e2e_test_for_prs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
name: Run e2e for topic branch
on:
pull_request:
paths-ignore:
- '**.md'
- 'cloudformation/*.yml'

jobs:
check-changed-files:
runs-on: ubuntu-20.04
name: Check changed files
outputs:
NEED_TO_RUN_TESTS: ${{ steps.decision.outputs.NEED_TO_RUN_TESTS }}
steps:
- id: files
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
- name: Make decision based on changed files
id: decision
run: |
needToRunTests=false
for changed_file in ${{ steps.files.outputs.all }}; do
if [[ ${changed_file} =~ ^(proxy|scripts|mgmt-lambda)\/.+$ ]]; then
needToRunTests=true
fi
if [[ ${changed_file} =~ ^\.github\/workflows\/.+$ ]]; then
needToRunTests=true
fi
done
echo $needToRunTests
echo NEED_TO_RUN_TESTS=${needToRunTests} >> $GITHUB_OUTPUT
run-e2e-for-topic-branch:
if: needs['check-changed-files'].outputs.NEED_TO_RUN_TESTS == 'true'
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
Expand Down
4 changes: 2 additions & 2 deletions buildspec-e2e-pr-join-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ version: 0.2
phases:
build:
commands:
- ls -la $CODEBUILD_SRC_DIR # rc branch, also called as primary source
- ls -la $CODEBUILD_SRC_DIR_SourceArtifact # topic branch
# $CODEBUILD_SRC_DIR => rc branch
# $CODEBUILD_SRC_DIR_SourceArtifact => topic branch
- cd $CODEBUILD_SRC_DIR_SourceArtifact
- git status
- cp $CODEBUILD_SRC_DIR/buildspec-e2e.yml buildspec-e2e.yml
Expand Down

0 comments on commit 0e1f9cb

Please sign in to comment.