Skip to content

Commit

Permalink
Automate checkings on push and tags
Browse files Browse the repository at this point in the history
Update github actions workflows to check tags signed.
Validate if code is not vulnarble.
  • Loading branch information
miry committed Mar 15, 2022
1 parent a783f6b commit 40d0432
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---

name: Analysis

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: 13 7 * * 6

jobs:
linting:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: shellcheck
uses: azohra/shell-linter@6bbeaa868df09c34ddc008e6030cfe89c03394a1
with:
path: scripts/test-*
severity: error

- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

vulnerabilities:
runs-on: ubuntu-latest

permissions:
security-events: write

steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: initialize
uses: github/codeql-action/init@v1
with:
languages: ruby

- name: codeql analyze
uses: github/codeql-action/analyze@v1
45 changes: 45 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---

name: Pre release

on:
push:
tags: [ v*.*.* ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

-
name: GPG config
run: |
mkdir -p ~/.gnupg
cat << EOF >> ~/.gnupg/options
keyserver keys.openpgp.org
keyserver-options auto-key-retrieve
EOF
-
name: Verify tag signature
run: |
# NOTE: Solve the problem with Github action checkout
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
version=${GITHUB_REF#refs/tags/*}
git show $version
git tag -v $version
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Run tests
on: [push]
---

name: Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 40d0432

Please sign in to comment.