~shom/ntfy

d329583dcb1bd30976eae20d9343f799aef716bc — Shom Bandopadhaya 2 years ago 95650d8
Build readme file for sourcehut through build automation
1 files changed, 27 insertions(+), 0 deletions(-)

A .build.yml
A .build.yml => .build.yml +27 -0
@@ 0,0 1,27 @@
image: alpine/edge
packages:
  - pandoc
  - curl
  - jq
secrets:
  - f6ce6e26-6f68-4ed1-93b7-359f72bca15f
environment:
  REPO_ID: 110812
  README: README.html
tasks:
  - convert-readme: |
      pandoc -o README.html ./ntfy/readme.org
  - update-readme: |
      set +x  # Avoid echoing the token
      jq -sR '{
          "query": "mutation UpdateRepo($id: Int!, $readme: String!) {
                       updateRepository(id: $id, input: { readme: $readme }) { id }
                   }",
          "variables": {
            "id": '$REPO_ID',
            "readme": .
          } }' < $README \
        | curl --oauth2-bearer "$(cat ~/.api-token)" \
          -H "Content-Type: application/json" \
          -d@- https://git.sr.ht/query &&
      echo "README set"