[Snyk] Security upgrade express from 4.16.4 to 4.21.0 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sample CI Pipeline | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-and-push: | |
name: Build and push image | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: my-sample-app | |
PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
REGISTRY_URL: gcr.io | |
HUMANITEC_ORG: rdstation | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Build docker image | |
- name: Build image | |
run: docker build --tag $REGISTRY_URL/$PROJECT_ID/$IMAGE_NAME:$GITHUB_SHA . | |
# Setup gcloud CLI | |
- uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: ${{ secrets.GCR_DEVOPS_SERVICE_ACCOUNT_KEY }} | |
# Configure docker to use the gcloud command-line tool as a credential helper | |
- run: gcloud auth configure-docker -q | |
# Push image to Google Container Registry | |
- name: Push image | |
run: docker push $REGISTRY_URL/$PROJECT_ID/$IMAGE_NAME:$GITHUB_SHA | |
# Inform Humanitec about new image | |
- name: Inform Humanitec | |
run: |- | |
curl -v \ | |
--request POST 'https://api.humanitec.io/orgs/'$HUMANITEC_ORG'/images/'$IMAGE_NAME'/builds' \ | |
--header 'Authorization: Bearer ${{ secrets.HUMANITEC_TOKEN }}' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{ | |
"branch": "'$GITHUB_REF_NAME'", | |
"commit": "'$GITHUB_SHA'", | |
"image": "'$REGISTRY_URL/$PROJECT_ID/$IMAGE_NAME:$GITHUB_SHA'", | |
"tags": ["'$GITHUB_SHA'"] | |
}' |