Skip to content

Commit

Permalink
make qa runners safe for qa
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottback committed Feb 3, 2024
1 parent 922fa83 commit d6eb5ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- qa
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: [ "main", "qa" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ "main", "qa" ]
schedule:
- cron: '39 5 * * 5'

Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/sync-from-reddit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
- cron: 17,47 * * * *

jobs:
sync_matrix:
strategy:
matrix:
branch: [ 'main', 'qa' ]
deploy: [ 'yes', 'no' ]
exclude:
- branch: 'qa'
- deploy: 'yes'

sync-from-reddit:
name: Sync from Reddit
runs-on: ubuntu-22.04
Expand All @@ -15,15 +24,9 @@ jobs:
permissions:
contents: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- uses: actions/checkout@v4
with:
ref: ${{ steps.extract_branch.outputs.branch }}

- ref: ${{ matrix.branch }}
- name: Configure git user
run: |
git config user.name 'github-actions[bot]'
Expand Down Expand Up @@ -56,7 +59,7 @@ jobs:
deploy:
name: Deploy site
needs: sync-from-reddit
if: "${{ needs.sync-from-reddit.outputs.new-commit != '' }}"
if: "${{ ( needs.sync-from-reddit.outputs.new-commit != '' ) && ( matrix.deploy != 'no' ) }}"
permissions:
contents: write
uses: ./.github/workflows/deploy.yml
Expand Down

0 comments on commit d6eb5ff

Please sign in to comment.