Skip to content

.github/workflows/tst.yml #22

.github/workflows/tst.yml

.github/workflows/tst.yml #22

Workflow file for this run

on:
# schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
inputs:
vim_tag:
description: 'Vim tag (empty=latest)'
default: ''
jobs:
check-updates-job:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.check-updates.outputs.updated }}
prev_vim_tag: ${{ steps.check-updates.outputs.prev_vim_tag }}
vim_tag: ${{ steps.check-updates.outputs.vim_tag }}
kstr0k_tag: ${{ steps.check-updates.outputs.kstr0k_tag }}
steps:
- name: Get latest tags
id: latest-tags
env:
MYOWNER: ${{ github.repository_owner }}
MYREPO: ${{ github.event.repository.name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GQL_Q1: |
query($myowner:String!,$myrepo:String!) {
appimage: repository(owner:$myowner, name:$myrepo) {
ref(qualifiedName: "refs/tags/v9.1.0225") {
target { oid }
}
}
vim: repository(owner:"vim", name:"vim") {
refs(refPrefix:"refs/tags/", last:1) {
edges { node { name } }
}
}
}
run: |
json=$(gh api graphql -F myowner="$MYOWNER" -F myrepo="$MYREPO" \
-f query="$GQL_Q1")
tee -a "$GITHUB_OUTPUT" <<EOGHO
json=$json
EOGHO
- name: Get previous release vim tag
id: prev-vim-tag
env:
MYOWNER: ${{ github.repository_owner }}
MYREPO: ${{ github.event.repository.name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GQL_Q2: |
query($myowner:String!,$myrepo:String!,$tag_oid:GitObjectID) {
appimage: repository(owner:$myowner, name:$myrepo) {
object(oid: $tag_oid ) { ... on Tag { message }}
}
}
run: |
json=$(gh api graphql -F myowner="$MYOWNER" -F myrepo="$MYREPO" \
-F tag_oid=${{ fromJSON(steps.latest-tags.outputs.json).data.appimage.ref.target.oid }} \
-f query="$GQL_Q2")
tee -a "$GITHUB_OUTPUT" <<EOGHO
json=$json
EOGHO
- name: Check updates
id: check-updates
run: |
vim_tag=${{ fromJSON(steps.latest-tags.outputs.json).data.vim.refs.edges[0].node.name }}
vim_forced_tag=${{ github.event.inputs.vim_tag }}
if [ -n "${vim_forced_tag}" ]; then
vim_tag=$vim_forced_tag
fi
prev_vim_tag="${{ fromJSON(steps.prev-vim-tag.outputs.json).data.appimage.object.message }}"
echo 'tags:' "(ours=${prev_vim_tag})" "(vim=${vim_tag})"