diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36b9fc..c8c81e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,14 @@ -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + inputs: + ref: + description: 'The branch, tag or SHA to checkout' + default: main + type: string jobs: snyk-security: @@ -11,7 +21,7 @@ jobs: contents: read security-events: write actions: read - + codeql-sast: name: CodeQL SAST scan uses: alphagov/govuk-infrastructure/.github/workflows/codeql-analysis.yml@main @@ -21,7 +31,7 @@ jobs: dependency-review: name: Dependency Review scan uses: alphagov/govuk-infrastructure/.github/workflows/dependency-review.yml@main - + # This matrix job runs the test suite against multiple Ruby and Rails versions test_matrix: strategy: @@ -36,6 +46,8 @@ jobs: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }}