Skip to content

fix: an admin should not be able to update or see itself #39

fix: an admin should not be able to update or see itself

fix: an admin should not be able to update or see itself #39

Workflow file for this run

name: CI
on: push
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Install dependencies
run: go mod download
- name: Set up env
run: cp .env.test .env
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
build_docker:
if: startsWith(github.event.ref, 'refs/tags/v')
name: Build and publish docker image
needs: build_and_test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
${{ github.ref_name }}
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}