Skip to content

Commit 5e19b83

Browse files
committed
Follow GHA Best Practices
1 parent 9204ad4 commit 5e19b83

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.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/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"

0 commit comments

Comments
 (0)