Skip to content

Commit

Permalink
Merge branch 'master' into update-renv-lock-init-new
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbeldo authored Aug 10, 2023
2 parents 1614481 + d110807 commit 83b8355
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,47 @@ on:
release:
types:
- released
pull_request:
pull_request_target:
branches:
- master
types:
- labeled
- unlabeled
- opened
- synchronize
- reopened

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
is-safe-to-run:
name: Sensitive jobs are safe to be run
runs-on: ubuntu-20.04
if: (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to run')) || github.event_name == 'release' || github.event_name == 'push'
steps:
- id: is-safe-to-run
name: Is safe to run
run: |-
echo "Safe to run, checks will proceed"
is-not-safe-to-run:
name: Sensitive jobs aren't labeled safe to be run
runs-on: ubuntu-20.04
if: (github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to run'))
steps:
- id: is-not-safe-to-run
name: The pull request hasn't been labeled safe to run
run: |-
echo "Pull request not labeled safe to run"
exit 1
uncheck-integration-test:
name: Mark integration test as not run
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
needs: is-safe-to-run
if: github.event_name == 'pull_request_target'
steps:
- id: get-pr-body
name: Get the current PR body
Expand Down Expand Up @@ -57,6 +85,7 @@ jobs:
build-docker:
name: Build Docker container
runs-on: ubuntu-20.04
needs: is-safe-to-run
strategy:
matrix:
project: ['pipeline-runner']
Expand Down Expand Up @@ -252,7 +281,7 @@ jobs:
deploy:
name: Deploy to Kubernetes
runs-on: ubuntu-20.04
needs: build-docker
needs: [build-docker, is-safe-to-run]
strategy:
max-parallel: 1
matrix:
Expand Down Expand Up @@ -434,7 +463,7 @@ jobs:
ready-to-merge:
name: Ready for merging
runs-on: ubuntu-20.04
needs: deploy
needs: [deploy, is-safe-to-run]
steps:
- id: ready-to-merge
name: Signal readiness to merge
Expand All @@ -444,7 +473,7 @@ jobs:
report-if-failed:
name: Report if workflow failed
runs-on: ubuntu-20.04
needs: [build-docker, deploy]
needs: [build-docker, deploy, is-safe-to-run]
if: failure() && github.ref == 'refs/heads/master'
steps:
- id: send-to-slack
Expand Down

0 comments on commit 83b8355

Please sign in to comment.