Skip to content

Commit 80826ba

Browse files
committed
Follow GHA Best Practices
1 parent 9204ad4 commit 80826ba

File tree

8 files changed

+23
-17
lines changed

8 files changed

+23
-17
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build and Deploy
2-
2+
permissions: read-all
33
on:
44
push:
55
branches: [ main ]

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build
2-
2+
permissions: read-all
33
on:
44
workflow_call:
55
inputs:

.github/workflows/deploy-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Deploy Artifacts
2-
2+
permissions: read-all
33
on:
44
workflow_call:
55
inputs:

.github/workflows/dispatch-deploy-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
env:
3131
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
BRANCH_NAME: ${{ inputs.branch-name }}
33-
run: gh workflow run deploy-docs.yml -r "$BRANCH_NAME" -f build-refname=${{ github.ref_name }}
33+
REF_NAME: ${{ github.ref_name }}
34+
run: gh workflow run deploy-docs.yml -r "$BRANCH_NAME" -f build-refname="$REF_NAME"
3435
- name: Dispatch (full build)
3536
if: ${{ inputs.build-type == 'full' }}
3637
env:

.github/workflows/perform-release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,31 +127,31 @@ jobs:
127127
ANNOUNCING_ID: ${{ inputs.slack-announcing-id }}
128128
WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
129129
run: |
130-
curl -X POST '${{ env.WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ "text": "${{ env.ANNOUNCING_ID }} `${{ env.VERSION }}` is available now" }' || true
130+
curl -X POST "${WEBHOOK_URL}" -H 'Content-Type: application/json' -d "{ \"text\": \"${ANNOUNCING_ID}\" `${VERSION}` is available now\" }" || true
131131
- name: Delete Previous Version
132132
if: ${{ steps.previous-release-milestone.outputs.version != '' }}
133133
env:
134134
VERSION: ${{ steps.previous-release-milestone.outputs.version }}
135-
run: ./gradlew deleteSaganRelease -PpreviousVersion=$VERSION -PgitHubAccessToken=$TOKEN
135+
run: ./gradlew deleteSaganRelease -PpreviousVersion="$VERSION" -PgitHubAccessToken="$TOKEN"
136136
- name: Create Released Version
137137
env:
138138
VERSION: ${{ steps.project-version.outputs.version }}
139-
run: ./gradlew createSaganRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
139+
run: ./gradlew createSaganRelease -PnextVersion="$VERSION" -PgitHubAccessToken="$TOKEN"
140140
- name: Close Release Milestone
141141
env:
142142
VERSION: ${{ steps.project-version.outputs.version }}
143-
run: ./gradlew closeMilestone -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
143+
run: ./gradlew closeMilestone -PnextVersion="$VERSION" -PgitHubAccessToken="$TOKEN"
144144
- name: Delete Previous Snapshot Version
145145
if: ${{ steps.previous-snapshot-version.outputs.version != '' }}
146146
env:
147147
VERSION: ${{ steps.previous-snapshot-version.outputs.version }}
148-
run: ./gradlew deleteSaganRelease -PpreviousVersion=$VERSION -PgitHubAccessToken=$TOKEN
148+
run: ./gradlew deleteSaganRelease -PpreviousVersion="$VERSION" -PgitHubAccessToken="$TOKEN"
149149
- name: Create Next Snapshot Version
150150
env:
151151
VERSION: ${{ steps.next-snapshot-version.outputs.version }}
152-
run: ./gradlew createSaganRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
152+
run: ./gradlew createSaganRelease -PnextVersion="$VERSION" -PgitHubAccessToken="$TOKEN"
153153
- name: Schedule Next Release (if not already scheduled)
154154
if: ${{ steps.has-oss-support.outputs.result == 'true' }}
155155
env:
156156
VERSION: ${{ steps.next-release-milestone.outputs.version }}
157-
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
157+
run: ./gradlew scheduleNextRelease -PnextVersion="$VERSION" -PgitHubAccessToken="$TOKEN"

.github/workflows/publish-plugins.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Publish Plugins
2-
2+
permissions: read-all
33
on:
44
workflow_call:
55
inputs:

.github/workflows/retrieve-spring-supported-versions.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,25 @@ jobs:
3030
runs-on: ubuntu-latest
3131
outputs:
3232
supported_versions: ${{ steps.get-supported-versions.outputs.supported_versions }}
33+
env:
34+
PROJECT: ${{ inputs.project }}
35+
REPOSITORY_NAME: ${{ inputs.repository_name }}
36+
TYPE: ${{ inputs.type }}
37+
3338
steps:
3439
- id: get-supported-versions
3540
shell: bash
3641
run: |
37-
if [ "${{ inputs.type }}" = "commercial" ]; then
38-
response=$(curl https://api.spring.io/projects/${{ inputs.project }}/generations | jq --arg current "$(date +%F)" -c '.["_embedded"]["generations"] | map(select((.commercialSupportEndDate + "T00:00:00") > $current and (.ossSupportEndDate + "T00:00:00") < $current)) | sort_by(.initialReleaseDate) | .[].name' -r ${{ inputs.additional_curl_args }})
42+
if [ "$TYPE" = "commercial" ]; then
43+
response=$(curl "https://api.spring.io/projects/$PROJECT/generations" | jq --arg current "$(date +%F)" -c '.["_embedded"]["generations"] | map(select((.commercialSupportEndDate + "T00:00:00") > $current and (.ossSupportEndDate + "T00:00:00") < $current)) | sort_by(.initialReleaseDate) | .[].name' -r ${{ inputs.additional_curl_args }})
3944
else
40-
response=$(curl -s https://api.spring.io/projects/${{ inputs.project }}/generations | jq --arg current "$(date +%F)" -c '.["_embedded"]["generations"] | map(select((.ossSupportEndDate + "T00:00:00") > $current)) | sort_by(.initialReleaseDate) | .[].name' -r ${{ inputs.additional_curl_args }})
45+
response=$(curl -s "https://api.spring.io/projects/$PROJECT/generations" | jq --arg current "$(date +%F)" -c '.["_embedded"]["generations"] | map(select((.ossSupportEndDate + "T00:00:00") > $current)) | sort_by(.initialReleaseDate) | .[].name' -r ${{ inputs.additional_curl_args }})
4146
fi
4247
4348
versions=""
4449
4550
for version in $(echo "$response" | tr '\n' ' '); do
46-
status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://github.com/${{ inputs.repository_name }}/tree/$version")
51+
status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://github.com/$REPOSITORY_NAME/tree/$version")
4752
if [ "$status_code" -eq 200 ]; then
4853
if [ -z "$versions" ]; then
4954
versions="$version"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Test
2-
2+
permissions: read-all
33
on:
44
workflow_call:
55
inputs:

0 commit comments

Comments
 (0)