From d46d8b09ae76d3131fb81208ac4842186f78c81c Mon Sep 17 00:00:00 2001 From: Shaun Hare Date: Sat, 18 May 2024 11:29:54 +0100 Subject: [PATCH 1/2] moved env and secret setting --- .github/workflows/cd.yaml | 14 ++++++++------ .github/workflows/maven.yaml | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 6dd4764..1b4b0fe 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -16,12 +16,11 @@ jobs: tag_name: ${{ steps.release.outputs.tag_name }} release_created: ${{ steps.release.outputs.release_created }} steps: - - uses: google-github-actions/release-please-action@v4 + - uses: googleapis/release-please-action@v4 id: release with: release-type: maven - - + publish: if: ${{needs.release-please.outputs.release_created}} runs-on: ubuntu-latest @@ -43,12 +42,15 @@ jobs: push: if: ${{needs.release-please.outputs.release_created}} + permissions: + contents: read + packages: write + name: Publish to GitHub Packages Apache Maven uses: ./.github/workflows/maven.yaml with: maven-goal: deploy + needs: release-please - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - + \ No newline at end of file diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index d1dbf31..17b2dfa 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -8,6 +8,10 @@ on: required: true default: 'package' type: string + secrets: + GITHUB_TOKEN: + description: 'GitHub token' + required: true permissions: contents: read @@ -15,6 +19,8 @@ permissions: jobs: build: name: build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From ed80908e2139184fcc92e9c53a7bade1038afb94 Mon Sep 17 00:00:00 2001 From: Shaun Hare Date: Sat, 18 May 2024 11:31:37 +0100 Subject: [PATCH 2/2] moved env and secret setting --- .github/workflows/maven.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 17b2dfa..8f22fc8 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -8,10 +8,6 @@ on: required: true default: 'package' type: string - secrets: - GITHUB_TOKEN: - description: 'GitHub token' - required: true permissions: contents: read