Skip to content

Fix job permissions for auth with Google #8

Fix job permissions for auth with Google

Fix job permissions for auth with Google #8

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*'
jobs:
publish:
if: github.repository == 'codebandits/gradle-container-plugin'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Install SOPS
uses: mdgreenwald/mozilla-sops-action@v1
- name: Load Infrastructure Configuration
uses: codebandits/github-actions/load-env@main
id: configuration
with:
path: ./.github/configuration.env
- uses: google-github-actions/auth@v2
with:
project_id: ${{ steps.configuration.outputs.GCP_PROJECT_ID }}
workload_identity_provider: ${{ steps.configuration.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ steps.configuration.outputs.GCP_SERVICE_ACCOUNT }}
- name: Set Version
run: |
TAG="${{ github.ref_name }}"
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Run Bootstrap
run: ./bootstrap.sh
- name: Publish Plugin
run: ./gradlew publishPlugins -Pversion=$VERSION --validate-only