Skip to content

Commit

Permalink
chore(main): Fix YAML prettier issues in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
HorizonNet committed Oct 8, 2024
1 parent 2a9beba commit c7a92a2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 66 deletions.
71 changes: 35 additions & 36 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Gradle Package
on:
push:
tags:
- 'v*'
- "v*"
workflow_dispatch:

jobs:
Expand All @@ -14,44 +14,43 @@ jobs:
# 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]')
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-22.04

permissions:
contents: read
packages: write

steps:
- 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
uses: actions/[email protected]
with:
java-version-file: .java-version
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew build

- name: Publish to GitHub Packages
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
uses: actions/[email protected]
with:
java-version-file: .java-version
distribution: "temurin"
server-id: github
settings-path: ${{ github.workspace }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew build

- name: Publish to GitHub Packages
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
53 changes: 26 additions & 27 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,31 @@ jobs:
# 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]')
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-22.04

steps:
- 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
uses: actions/[email protected]
with:
java-version-file: .java-version
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew build
- 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
uses: actions/[email protected]
with:
java-version-file: .java-version
distribution: "temurin"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew build
5 changes: 2 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
# 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]')
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-22.04

steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
Expand Down

0 comments on commit c7a92a2

Please sign in to comment.