Skip to content

chore(ci): apply security best practices #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:
branches:
- main

permissions:
contents: read

jobs:

backport:
permissions:
contents: write # for Git to git push
name: Backport change to branch ${{ matrix.branch }}
continue-on-error: true
strategy:
Expand All @@ -17,8 +22,13 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
with:
fetch-depth: 0
- name: Create a cherry-pick PR
Expand Down
48 changes: 38 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- release-*
- v*

permissions:
contents: read

jobs:

build-static:
Expand All @@ -19,13 +22,18 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: ${{ matrix.go }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Build
run: |
git submodule update --init
Expand All @@ -42,13 +50,18 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Build
run: |
git submodule update --init
Expand All @@ -68,13 +81,18 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Build libgit2 ${{ matrix.libgit2 }}
run: |
git submodule update --init
Expand All @@ -91,13 +109,18 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Build libgit2
run: |
git submodule update --init
Expand All @@ -110,13 +133,18 @@ jobs:
name: Check generated files were not modified
runs-on: ubuntu-20.04
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Install libgit2 build dependencies
run: |
git submodule update --init
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
with:
fetch-depth: 0
- name: Bump version and push tag
Expand Down
Loading