mirror of
https://github.com/irongut/CodeCoverageSummary.git
synced 2026-05-19 16:30:14 +02:00
use StepSecurity Secure Workflows for builds #49
This commit is contained in:
@@ -6,16 +6,25 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: CI Build
|
name: CI Build
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
|
||||||
|
with:
|
||||||
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
|
||||||
|
|
||||||
- name: Setup .Net
|
- name: Setup .Net
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,27 @@ env:
|
|||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Test Build
|
name: Test Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
|
||||||
|
with:
|
||||||
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup .Net
|
- name: Setup .Net
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
@@ -40,11 +49,17 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
|
||||||
|
with:
|
||||||
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@@ -52,12 +67,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Build + Push Docker image
|
- name: Build + Push Docker image
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
|||||||
Reference in New Issue
Block a user