Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIDCS-3292: Push the new workflow and fixes to main #31

Merged
merged 9 commits into from
Jan 30, 2025
27 changes: 27 additions & 0 deletions .github/workflows/auto-set-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Auto-set Base Branch to Develop

on:
pull_request:
types: [opened]

jobs:
set-base-branch:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Check and Update Base Branch
run: |
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
BASE_BRANCH="${{ github.event.pull_request.head.ref }}"

if [ "$TARGET_BRANCH" = "main" ] && [ "$BASE_BRANCH" != "develop" ]; then
echo "Switching base branch from $TARGET_BRANCH to develop..."
gh pr edit ${{ github.event.pull_request.number }} --base develop
echo "Base branch updated to 'develop'."
else
echo "No changes needed: Target branch is '$TARGET_BRANCH' and base branch is '$BASE_BRANCH'."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-vcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to VCR
on:
pull_request:
branches:
- main
- develop
types: [closed]

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ jobs:
yarn test

- name: SonarCloud Scan
if: steps.check-skip-ci.outputs.result == 'false'
if: steps.check-skip-ci.outputs.result == 'false' && github.event.pull_request.head.repo.fork == false
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Run integration tests
if: steps.check-skip-ci.outputs.result == 'false'
if: steps.check-skip-ci.outputs.result == 'false' && github.event.pull_request.head.repo.fork == false
run: |
Xvfb :99 & export DISPLAY=:99
yarn test:integration
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import util from 'util';
import { describe, jest } from '@jest/globals';
import blockCallsForArgs from '../../helpers/blockCallsForArgs';
import delay from '../../helpers/delay';
import blockCallsForArgs from '../helpers/blockCallsForArgs';
import delay from '../helpers/delay';

describe('blockCallsForArgs', () => {
it('executes function with args', async () => {
Expand Down
Loading