-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (46 loc) · 1.38 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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"))' |
map(.id)
- name: Get the result
run: |
echo '${{ steps.jq_filter.outputs.result }}'