Skip to content

add required token

add required token #1

name: Release Artifact Publisher
on:
workflow_call:
inputs:
release_version:
required: true
type: string
repository_url:
required: true
type: string
gradle_command:
required: true
type: string
branch:
required: true
type: string
secrets:
GITHUB_TOKEN:

Check failure on line 19 in .github/workflows/java-build-release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/java-build-release.yaml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
release:
runs-on: ubuntu-latest
env:
GH_USER_NAME: ${{ github.actor }}
steps:
- name: Validate Branch
if: ${{ github.event_name != 'release' && github.ref != format('refs/heads/{0}', inputs.branch) }}
run: |
echo "This workflow can only run on the branch '${{ inputs.branch }}'."
exit 1
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '21'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup git credentials
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
name: 'reportportal.io'
email: '[email protected]'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Artifacts
run: |
${{ inputs.gradle_command }} --no-build-cache --exclude-task test \
-PreleaseMode=true \
-PgithubUserName=${{env.GH_USER_NAME}} \
-PgithubToken=${{ secrets.GITHUB_TOKEN }} \
-PpublishRepo=${{ inputs.repository_url }}${{ github.repository }} \
-PgpgPassphrase=${{ secrets.GPG_PASSPHRASE }} \
-PgpgPrivateKey="${{ secrets.GPG_PRIVATE_KEY }}" \
-Prelease.releaseVersion=${{ inputs.release_version }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/libs/service-api-${{ inputs.release_version }}.jar
asset_name: service-api-${{ inputs.release_version }}.jar
asset_content_type: application/java-archive