Skip to content

Commit

Permalink
Cleaning up permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
cowwoc committed Oct 31, 2024
1 parent 834301c commit f84779b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: |
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
pull_request_target:
types: [ opened,closed,synchronize ]

# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
permissions:
actions: write
contents: write
Expand All @@ -17,14 +16,10 @@ jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
# https://github.com/contributor-assistant/github-action
- name: "CLA Assistant Lite"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
# This token is required only if you have configured to store the signatures in a remote repository/organization
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACCESS_TOKEN }}
with:
path-to-signatures: 'cla/version1/signatures/cla.json'
path-to-document: 'https://github.com/cowwoc/pouch/blob/master/cla/version1/cla.md' # e.g. a CLA or a DCO document
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/deploy_to_maven_central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ on:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: write
id-token: write

env:
STAGING_HOST: "oss.sonatype.org"
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
jobs:
open-release:
name: Open release
runs-on: ubuntu-latest
outputs:
INITIAL_MASTER_POSITION: ${{ steps.create-tag.outputs.INITIAL_MASTER_POSITION }}
Expand Down Expand Up @@ -106,9 +111,15 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.open-release.outputs.TAG }}
token: ${{ secrets.WORKFLOW_TOKEN }}
fetch-depth: 0
- uses: actions/setup-java@v4

- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "Gili Tzabari"
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: |
Expand Down Expand Up @@ -154,13 +165,13 @@ jobs:
git push
close-release:
name: Close release
needs: [ open-release, deploy ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.open-release.outputs.TAG }}
token: ${{ secrets.WORKFLOW_TOKEN }}
- uses: actions/setup-java@v4
with:
distribution: zulu
Expand Down Expand Up @@ -189,16 +200,17 @@ jobs:
# Cleanup on failure: https://stackoverflow.com/a/74562058/14731
on-failure:
needs: [ open-release, deploy, document, close-release ]
name: On failure
needs: [ open-release, deploy, close-release ]
runs-on: ubuntu-latest
if: ${{ failure() || cancelled() }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.WORKFLOW_TOKEN }}
fetch-depth: 0
- uses: actions/setup-java@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: |
Expand Down

0 comments on commit f84779b

Please sign in to comment.