diff --git a/.gitea/workflows/verify-badges-delivery.yml b/.gitea/workflows/verify-badges-delivery.yml new file mode 100644 index 0000000..9e596b3 --- /dev/null +++ b/.gitea/workflows/verify-badges-delivery.yml @@ -0,0 +1,34 @@ +name: Verify badges delivery +on: + push: + branches: [verify-badges-delivery] +jobs: + verify: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4.2.2 + - name: Commit an SVG to an orphan branch with the token of the run + run: | + set -eu + d=$(mktemp -d) + cat > "$d/code-files.svg" <<'SVG' + code files: 12files12 + SVG + git config user.name "badges-verify" + git config user.email "badges-verify@invalid" + git checkout --orphan badges-verify + git rm -rf -q . || true + cp "$d/code-files.svg" code-files.svg + git add code-files.svg + git commit -q -m "Update code metrics badges [skip ci]" + git push origin HEAD:refs/heads/badges-verify + echo "pushed" + git ls-remote origin refs/heads/badges-verify + - name: Read the raw URL + run: | + set -eu + u="${{ github.server_url }}/${{ github.repository }}/raw/branch/badges-verify/code-files.svg" + echo "$u" + curl -s -D - -o /dev/null -H "Authorization: token ${{ github.token }}" "$u" | head -12