mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2026-07-15 20:39:58 +02:00
Switch out pr url lookup method with repos/repo/pulls + filter (#71)
This commit is contained in:
parent
219d11877b
commit
8d2e9d2fcf
@ -34,10 +34,14 @@ jobs:
|
|||||||
id: lookup
|
id: lookup
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} # Not inlined below to prevent injection from branch names
|
||||||
run: |
|
run: |
|
||||||
PR_URL=$(gh api \
|
PR_URL=$(gh api --method GET \
|
||||||
"repos/${{ github.repository }}/commits/${{ github.event.workflow_run.head_sha }}/pulls" \
|
"repos/${{ github.repository }}/pulls" \
|
||||||
--jq "[.[] | select(.head.sha == \"${{ github.event.workflow_run.head_sha }}\" and .state == \"open\")] | first | .html_url // empty")
|
-f state=open \
|
||||||
|
-f head="${{ github.event.workflow_run.head_repository.owner.login }}:${HEAD_BRANCH}" \
|
||||||
|
-f base="${{ github.event.repository.default_branch }}" \
|
||||||
|
--jq "([.[] | select(.head.sha == \"${{ github.event.workflow_run.head_sha }}\")] | first | .html_url) // (first | .html_url) // empty")
|
||||||
|
|
||||||
if [ -z "$PR_URL" ]; then
|
if [ -z "$PR_URL" ]; then
|
||||||
echo "Failed to find a PR url"
|
echo "Failed to find a PR url"
|
||||||
|
|||||||
10
.github/workflows/trigger-rebuild-with-deps.yml
vendored
10
.github/workflows/trigger-rebuild-with-deps.yml
vendored
@ -23,10 +23,14 @@ jobs:
|
|||||||
id: lookup
|
id: lookup
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} # Not inlined below to prevent injection from branch names
|
||||||
run: |
|
run: |
|
||||||
PR_URL=$(gh api \
|
PR_URL=$(gh api --method GET \
|
||||||
"repos/${{ github.repository }}/commits/${{ github.event.workflow_run.head_sha }}/pulls" \
|
"repos/${{ github.repository }}/pulls" \
|
||||||
--jq "[.[] | select(.head.sha == \"${{ github.event.workflow_run.head_sha }}\" and .state == \"open\")] | first | .html_url // empty")
|
-f state=open \
|
||||||
|
-f head="${{ github.event.workflow_run.head_repository.owner.login }}:${HEAD_BRANCH}" \
|
||||||
|
-f base="${{ github.event.repository.default_branch }}" \
|
||||||
|
--jq "([.[] | select(.head.sha == \"${{ github.event.workflow_run.head_sha }}\")] | first | .html_url) // (first | .html_url) // empty")
|
||||||
|
|
||||||
if [ -z "$PR_URL" ]; then
|
if [ -z "$PR_URL" ]; then
|
||||||
echo "Failed to find a PR url"
|
echo "Failed to find a PR url"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user