Compare commits
1 commit
aae8a6d464
...
35ddc2d150
Author | SHA1 | Date | |
---|---|---|---|
35ddc2d150 |
2 changed files with 9 additions and 3 deletions
|
@ -1,11 +1,9 @@
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name == 'push'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "https://code.forgejo.org/actions/checkout@v4"
|
- uses: "https://code.forgejo.org/actions/checkout@v4"
|
||||||
- run: nix --version
|
- run: nix --version
|
||||||
|
@ -30,7 +28,6 @@ jobs:
|
||||||
report-size:
|
report-size:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "https://git.salame.cl/actions/checkout@v4"
|
- uses: "https://git.salame.cl/actions/checkout@v4"
|
||||||
- run: nix --version
|
- run: nix --version
|
||||||
|
|
|
@ -73,12 +73,21 @@ if [ "${CI-false}" = "true" ]; then
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
||||||
-H 'accept: application/json' |
|
-H 'accept: application/json' |
|
||||||
jq --arg head_ref "$GITHUB_HEAD_REF" '.[] | select(.head.ref == $head_ref) | .number')
|
jq --arg head_ref "$GITHUB_HEAD_REF" '.[] | select(.head.ref == $head_ref) | .number')
|
||||||
|
|
||||||
|
if [ -z "$pr_number" ]; then
|
||||||
|
echo "No PR created for this pull request"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Retrieved index: $pr_number" >&2
|
echo "Retrieved index: $pr_number" >&2
|
||||||
echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number" >&2
|
echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number" >&2
|
||||||
|
|
||||||
echo 'Generating comment body' >&2
|
echo 'Generating comment body' >&2
|
||||||
comment=$(markdown)
|
comment=$(markdown)
|
||||||
|
|
||||||
echo 'Posting comment:' >&2
|
echo 'Posting comment:' >&2
|
||||||
echo "$comment" >&2
|
echo "$comment" >&2
|
||||||
|
|
||||||
echo 'Request data:' >&2
|
echo 'Request data:' >&2
|
||||||
data=$(echo '{}' | jq --arg comment "$comment" '.body=$comment')
|
data=$(echo '{}' | jq --arg comment "$comment" '.body=$comment')
|
||||||
echo "$data" >&2
|
echo "$data" >&2
|
||||||
|
|
Loading…
Add table
Reference in a new issue