Skip to content

Fix CVE-2022-32149

Fix CVE-2022-32149 #49

Workflow file for this run

---
name: ci
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
proto_ref:
proto_sha:
push:
branches:
- main
- v*
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for PRs
pull_request:
env:
VAULT_ADDR: https://vault.eng.aserto.com/
GO_VERSION: "1.23"
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Read Configuration
uses: hashicorp/vault-action@v3
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
-
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.CODEGEN_APP_ID }}
private-key: ${{ secrets.CODEGEN_APP_KEY }}
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Install dependencies
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global user.email "[email protected]"
git config --global user.name "Aserto Bot"
eval `ssh-agent`
ssh-add $HOME/.ssh/id_rsa
go run mage.go deps
-
name: Clean generated code
run: go run mage.go clean
-
name: Generate
run: go run mage.go generate
-
name: Commit changes
id: commit_changes
if: github.event_name == 'workflow_dispatch'
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
-
name: Dispatch to aserto-dev/ts-authorizer if a change was committed
if: steps.commit_changes.outputs.committed && github.event_name == 'workflow_dispatch'
uses: benc-uk/workflow-dispatch@v1
with:
inputs: '{"OPENAPI_SHA": "${{ steps.commit_changes.outputs.commit_sha }}", "PROTO_REF": "${{ github.event.inputs.proto_ref }}"}'
ref: main
repo: aserto-dev/ts-authorizer
token: ${{ steps.vault.outputs.READ_WRITE_TOKEN }}
workflow: generate
release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Read Configuration
uses: hashicorp/vault-action@v3
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/readme "README_OAS_AUTHORIZER_KEY" | README_OAS_AUTHORIZER_KEY;
kv/data/readme "AUTHORIZER_API_DEFINITION_ID" | AUTHORIZER_API_DEFINITION_ID;
- name: Checkout
uses: actions/checkout@v4
- name: Publish to readme.io
uses: readmeio/rdme@v8
with:
rdme: openapi ./publish/directory/openapi.json --key=${{ steps.vault.outputs.README_OAS_AUTHORIZER_KEY }} --id ${{ steps.vault.outputs.AUTHORIZER_API_DEFINITION_ID }}