Skip to content
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

[StepSecurity] ci: Harden GitHub Actions #1426

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,7 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@807578363a7869ca324a79039e6db9c843e0e100
piksel marked this conversation as resolved.
Show resolved Hide resolved

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -69,4 +69,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100
piksel marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
- uses: actions/first-interaction@1d8459ca65b335265f1285568221e229d45a995e
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: >
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
python-version: '3.10'
cache: 'pip'
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- uses: dominikh/staticcheck-action@v1.2.0
- uses: dominikh/staticcheck-action@a3513ade2e5cb8075ba1c1ed1890a989cf0f2aa0
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
version: "2022.1.1"
test:
Expand All @@ -36,34 +36,34 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- name: Run tests
run: |
go test -v -coverprofile coverage.out -covermode atomic ./...
- name: Publish coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- name: Build
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
version: v0.155.0
args: --snapshot --skip-publish --debug
16 changes: 8 additions & 8 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18
- name: Build
run: ./build.sh
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18
- name: Test
run: go test -v -coverprofile coverage.out -covermode atomic ./...
- name: Publish coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
Expand All @@ -37,17 +37,17 @@ jobs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
- name: Publish to Docker Hub
uses: jerray/publish-docker-action@master
uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
file: dockerfiles/Dockerfile.self-contained
repository: containrrr/watchtower
tags: latest-dev
- name: Publish to GHCR
uses: jerray/publish-docker-action@master
uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_GHCR_PAT }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- name: Install linter
Expand All @@ -42,11 +42,11 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- name: Run tests
Expand All @@ -64,26 +64,26 @@ jobs:
TAG: ${{ github.event.release.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.18.x
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v2
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_GHCR_PAT }}
registry: ghcr.io
- name: Build
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a
piksel marked this conversation as resolved.
Show resolved Hide resolved
with:
version: v0.155.0
args: --debug
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
uses: andrewslotin/go-proxy-pull-action@bfc19ec6536e1638181b2ad6a03e16c7ccfb122f
piksel marked this conversation as resolved.
Show resolved Hide resolved



Expand Down