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

fix: adds permission to token. #10

Merged
merged 3 commits into from
Jul 7, 2024
Merged
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
30 changes: 21 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Release

on:
pull_request:
Expand All @@ -8,21 +8,33 @@ on:
- ".github/workflows/release.yaml"

workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'main'

jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4

- name: Checkout
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
ref: ${{ github.ref }}

- name: Generate tag
id: tag
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "value=dev" >> $GITHUB_OUTPUT
else
echo "value=${{ github.ref }}" >> $GITHUB_OUTPUT
fi

- name: Setup Go
uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -51,12 +63,12 @@ jobs:
context: extauthz
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: openfga/openfga-envoy:${{ github.event.inputs.branch || 'dev' }}
tags: openfga/openfga-envoy:${{ steps.tag.outputs.value }}

- name: Write summary
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "The image is available:" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "docker pull ghcr.io/openfga/openfga-envoy:${{ github.event.inputs.branch }}@${{ steps.push.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
echo "docker pull ghcr.io/openfga/openfga-envoy:${{ steps.tag.outputs.value }}@${{ steps.push.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
Loading