Skip to content

Postaction

Postaction #120

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/graphql-action@v2.x
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
uses: sergeysova/jq-action@v2
with:
cmd: |
jq '.repository.releases.nodes[].releaseAssets.nodes[] | select(.name | endswith('.blockmap'))' \
${{ steps.get_latest_release.outputs.data }} -r
- name: Get the result
run: |
echo ${{ steps.jq_filter.outputs.data }}