Skip to content

Monitor ASIX upstream driver #4

Monitor ASIX upstream driver

Monitor ASIX upstream driver #4

name: Monitor ASIX upstream driver
on:
schedule:
- cron: "17 4 * * 1"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Check ASIX product page
id: upstream
shell: bash
run: |
set +e
bash ./scripts/check-upstream.sh --json > upstream-status.json
status_code=$?
set -e
cat upstream-status.json
if [[ ${status_code} -ne 0 && ${status_code} -ne 3 ]]; then
exit "${status_code}"
fi
if [[ ${status_code} -eq 3 ]]; then
echo 'update=true' >> "${GITHUB_OUTPUT}"
else
echo 'update=false' >> "${GITHUB_OUTPUT}"
fi
- name: Open an issue for manual review
if: steps.upstream.outputs.update == 'true'
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
const status = JSON.parse(fs.readFileSync('upstream-status.json', 'utf8'));
const title = `ASIX driver ${status.latest_version} is available`;
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
per_page: 100,
});
if (issues.some(issue => issue.title === title)) {
core.info('A matching open issue already exists.');
return;
}
const body = [
`The scheduled monitor found ASIX driver **${status.latest_version}**`,
`(current manifest: **${status.current_version}**).`,
'',
`Vendor-supported kernel: ${status.latest_supported_kernel}`,
`Release date: ${status.latest_release_date}`,
`Product page: ${status.product_page}`,
`Download endpoint: ${status.latest_download_url}`,
'',
'Manual action is required: download and inspect the archive, review licensing,',
'update the manifest and checksum, rebase patches, and let all mandatory CI jobs pass.',
'Do not attach or commit the ASIX archive or generated Debian package.',
].join('\n');
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body,
});