Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2646f94cdd |
@@ -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'
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="code files: 12"><title>code files: 12</title><rect width="60" height="20" fill="#555"/><rect x="60" width="30" height="20" fill="#007ec6"/><text x="5" y="14" fill="#fff" font-size="11">files</text><text x="65" y="14" fill="#fff" font-size="11">12</text></svg>
|
||||
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
|
||||
Reference in New Issue
Block a user