Skip to content

Postaction

Postaction #125

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
run: |
echo '${{ steps.get_latest_release.outputs.data }}' | jq \
'.repository.releases.nodes[].releaseAssets.nodes[] | select(.name | endswith(".blockmap"))'
- name: Get the result
run: |
echo '${{ fromJson(steps.jq_filter.outputs) }}'