1name: margin2# Weekly: fuel prices against Cloudflare's rates at the current bitcoin price.3# The table lands in the run summary; a line under the target margin opens or4# refreshes one issue.5on:6 schedule:7 - cron: "0 9 * * 1"8 workflow_dispatch:9permissions:10 contents: read11 issues: write12jobs:13 margin:14 runs-on: ubuntu-latest15 steps:16 - uses: actions/checkout@v517 - uses: actions/setup-node@v518 with:19 node-version: 2220 - name: Compute21 id: compute22 run: |23 set +e24 npm run -s margin > margin.md25 echo "below=$?" >> "$GITHUB_OUTPUT"26 cat margin.md >> "$GITHUB_STEP_SUMMARY"27 - name: Flag28 if: steps.compute.outputs.below == '1'29 env:30 GH_TOKEN: ${{ github.token }}31 run: |32 title="Fuel prices below the margin target"33 n=$(gh issue list --state open --search "$title in:title" --json number --jq '.[0].number')34 if [ -n "$n" ]; then gh issue comment "$n" --body-file margin.md; else gh issue create --title "$title" --body-file margin.md; fi