Skip to content

chore: Allow GitHub bot to trigger gradle-publish #409

chore: Allow GitHub bot to trigger gradle-publish

chore: Allow GitHub bot to trigger gradle-publish #409

Workflow file for this run

---
name: Gradle Package
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: Gradle Package
# If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]".
# Otherwise, clone it normally.
if: |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:

Check failure on line 25 in .github/workflows/gradle-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/gradle-publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 25
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Checkout
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version-file: .java-version
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Build with Gradle
uses: gradle/actions/[email protected]
with:
arguments: build
- name: Publish to GitHub Packages
uses: gradle/actions/[email protected]
with:
arguments: publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}