Skip to content

Commit

Permalink
Ensure shas retrieved by workflow are ordered by date (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-cattermole committed Jan 15, 2024
1 parent 541675d commit c9e8173
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-stored-dependencies-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
steps:
- name: Fetch dependencies images list
id: fetch
uses: fjogeleit/http-request-action@master
uses: fjogeleit/http-request-action@v1
with:
method: 'GET'
url: ${{env.IMG_REPO_URL}}${{ matrix.repository }}?includeTags=true
- name: Parse the list to get the last SHA
id: extract-sha-var
run: |
echo "sha=$(echo '${{ steps.fetch.outputs.response }}' | jq -c -r '.tags | keys_unsorted | .[] | select(.|test("[0-9a-f]{5,40}"))' | jq -Rn '[inputs]' | jq -c -r '.[0]')" >> $GITHUB_OUTPUT
echo "sha=$(echo '${{ steps.fetch.outputs.response }}' | jq -c -r '.tags | to_entries | sort_by(.value.last_modified | strptime("%a, %d %b %Y %H:%M:%S -0000"))[].key | select(.|test("[0-9a-f]{5,40}"))' | jq -Rn '[inputs]' | jq -c -r '.[-1]')" >> $GITHUB_OUTPUT
echo "var=$(echo ${{ matrix.repository }} | sed -E 's/-/_/g;s/[a-z]/\U&/g')_SHA" >> $GITHUB_OUTPUT
- name: Update stored variable
id: update
Expand Down

0 comments on commit c9e8173

Please sign in to comment.