Skip to content

Postaction

Postaction #150

Workflow file for this run

name: Clean release assets
on:
push:
branches:
- "post-actions"
jobs:
clean-release:
runs-on: ubuntu-latest
steps:
- name: Get latest release info
id: get_latest_release
uses: octokit/[email protected]
with:
query: |
query release($owner:String!,$repo:String!) {
repository(owner:$owner,name:$repo) {
releases(first:1) {
nodes {
releaseAssets(first:20) {
nodes {
id
name
}
}
}
}
}
}
variables: |
owner: ${{ github.event.repository.owner.name }}
repo: ${{ github.event.repository.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the request data
run: |
echo 'latest release: ${{ steps.get_latest_release.outputs.data }}'
- name: Filter requested data
id: jq_filter
run: |
blockmap_ids=$(echo '${{ steps.get_latest_release.outputs.data }}' | jq \
-r '.repository.releases.nodes[].releaseAssets.nodes |
map(select(.name | endswith(".blockmap")).id) | join(",")')
echo "BLOCKMAP_IDS=$blockmap_ids" >> $GITHUB_ENV
- name: Get the result
run: |
echo "Blockmap IDs: $BLOCKMAP_IDS"