mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-30 14:44:31 +02:00
ci(blocked-pr): use app token
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
e28dd30d87
commit
187728c1f2
25
.github/workflows/blocked-prs.yml
vendored
25
.github/workflows/blocked-prs.yml
vendored
@ -19,13 +19,14 @@ jobs:
|
|||||||
name: Check Blocked Status
|
name: Check Blocked Status
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
statuses: write
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Generate token
|
||||||
|
id: generate-token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.PULL_REQUEST_APP_ID }}
|
||||||
|
private-key: ${{ secrets.PULL_REQUEST_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Checkout Default Branch
|
- name: Checkout Default Branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -35,7 +36,7 @@ jobs:
|
|||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
id: dispatch_event_setup
|
id: dispatch_event_setup
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
PR_NUMBER: ${{ inputs.pr_id }}
|
PR_NUMBER: ${{ inputs.pr_id }}
|
||||||
run: |
|
run: |
|
||||||
# setup env for the rest of the workflow
|
# setup env for the rest of the workflow
|
||||||
@ -112,7 +113,7 @@ jobs:
|
|||||||
id: blocking_data
|
id: blocking_data
|
||||||
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
|
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
BLOCKING_PRS: ${{ steps.pr_ids.outputs.prs }}
|
BLOCKING_PRS: ${{ steps.pr_ids.outputs.prs }}
|
||||||
run: |
|
run: |
|
||||||
blocked_pr_data=$(
|
blocked_pr_data=$(
|
||||||
@ -147,7 +148,7 @@ jobs:
|
|||||||
if: (fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0) && !contains(fromJSON(env.JOB_DATA).prLabels, 'blocked') && !fromJSON(steps.blocking_data.outputs.all_merged)
|
if: (fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0) && !contains(fromJSON(env.JOB_DATA).prLabels, 'blocked') && !fromJSON(steps.blocking_data.outputs.all_merged)
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
gh -R ${{ github.repository }} issue edit --add-label 'blocked' $PR_NUMBER
|
gh -R ${{ github.repository }} issue edit --add-label 'blocked' $PR_NUMBER
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ jobs:
|
|||||||
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0 && fromJSON(steps.blocking_data.outputs.all_merged)
|
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0 && fromJSON(steps.blocking_data.outputs.all_merged)
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
gh -R ${{ github.repository }} issue edit --remove-label 'blocked' $PR_NUMBER
|
gh -R ${{ github.repository }} issue edit --remove-label 'blocked' $PR_NUMBER
|
||||||
|
|
||||||
@ -176,7 +177,7 @@ jobs:
|
|||||||
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
|
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
BLOCKING_DATA: ${{ steps.blocking_data.outputs.data }}
|
BLOCKING_DATA: ${{ steps.blocking_data.outputs.data }}
|
||||||
run: |
|
run: |
|
||||||
pr_head_sha=$(jq -r '.prHeadSha' <<< "$JOB_DATA")
|
pr_head_sha=$(jq -r '.prHeadSha' <<< "$JOB_DATA")
|
||||||
@ -229,5 +230,5 @@ jobs:
|
|||||||
comment_id: "block_pr_dependencies"
|
comment_id: "block_pr_dependencies"
|
||||||
issue_number: ${{ env.PR_NUMBER }}
|
issue_number: ${{ env.PR_NUMBER }}
|
||||||
repository: ${{ github.repository }}
|
repository: ${{ github.repository }}
|
||||||
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
gh_token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|
||||||
|
16
.github/workflows/merge-blocking-pr.yml
vendored
16
.github/workflows/merge-blocking-pr.yml
vendored
@ -14,16 +14,18 @@ jobs:
|
|||||||
# find the open pr's it was blocked by and trigger a refresh of their state
|
# find the open pr's it was blocked by and trigger a refresh of their state
|
||||||
if: github.event.pull_request.merged == true && contains( join( github.event.pull_request.labels.*.name, ',' ), 'blocking' )
|
if: github.event.pull_request.merged == true && contains( join( github.event.pull_request.labels.*.name, ',' ), 'blocking' )
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Generate token
|
||||||
|
id: generate-token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.PULL_REQUEST_APP_ID }}
|
||||||
|
private-key: ${{ secrets.PULL_REQUEST_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Gather Dependent PRs
|
- name: Gather Dependent PRs
|
||||||
id: gather_deps
|
id: gather_deps
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
run: |
|
run: |
|
||||||
blocked_prs=$(
|
blocked_prs=$(
|
||||||
@ -43,7 +45,7 @@ jobs:
|
|||||||
- name: Trigger Blocked PR Workflows for Dependants
|
- name: Trigger Blocked PR Workflows for Dependants
|
||||||
if: fromJSON(steps.gather_deps.outputs.numdeps) > 0
|
if: fromJSON(steps.gather_deps.outputs.numdeps) > 0
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
DEPS: ${{ steps.gather_deps.outputs.deps }}
|
DEPS: ${{ steps.gather_deps.outputs.deps }}
|
||||||
run: |
|
run: |
|
||||||
while read -r pr ; do
|
while read -r pr ; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user