From aa8a02fd3d87a7cbd855455f2e9e45adabe8430d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 5 Feb 2026 22:38:54 +0100 Subject: [PATCH] workflows/sync_pull-requests: bump to 0.7.4 Signed-off-by: Patrik Oldsberg --- .../workflows/sync_pull-requests-trigger.yml | 2 ++ .github/workflows/sync_pull-requests.yml | 35 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync_pull-requests-trigger.yml b/.github/workflows/sync_pull-requests-trigger.yml index 1e37b2f88a..10430b18a6 100644 --- a/.github/workflows/sync_pull-requests-trigger.yml +++ b/.github/workflows/sync_pull-requests-trigger.yml @@ -27,12 +27,14 @@ jobs: LABEL_ADDED: ${{ github.event.action == 'labeled' && github.event.label.name || '' }} REVIEW_STATE: ${{ github.event.review.state }} ACTOR: ${{ github.actor }} + ACTION: ${{ github.event.action }} run: | mkdir -p ./context echo "$PR_NUMBER" > ./context/pr-number echo "$LABEL_ADDED" > ./context/label-added echo "$REVIEW_STATE" > ./context/review-state echo "$ACTOR" > ./context/actor + echo "$ACTION" > ./context/action - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/.github/workflows/sync_pull-requests.yml b/.github/workflows/sync_pull-requests.yml index 802c8258eb..9bba4f9307 100644 --- a/.github/workflows/sync_pull-requests.yml +++ b/.github/workflows/sync_pull-requests.yml @@ -2,14 +2,17 @@ name: Sync Pull Requests on: workflow_run: - workflows: ['Sync Pull Requests Trigger'] + workflows: ['Sync Pull Requests Trigger', 'CI', 'E2E Linux'] types: - completed jobs: + # Runs when Sync Pull Requests Trigger completes (PR events like opened, labeled, reviewed) run: runs-on: ubuntu-latest - if: github.event.workflow_run.conclusion == 'success' + if: > + github.event.workflow_run.name == 'Sync Pull Requests Trigger' && + github.event.workflow_run.conclusion == 'success' steps: - name: Harden Runner uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 @@ -37,10 +40,11 @@ jobs: core.setOutput('label-added', fs.readFileSync('./context/label-added', 'utf8').trim()); core.setOutput('review-state', fs.readFileSync('./context/review-state', 'utf8').trim()); core.setOutput('actor', fs.readFileSync('./context/actor', 'utf8').trim()); + core.setOutput('action', fs.readFileSync('./context/action', 'utf8').trim()); - name: Backstage PR automation if: steps.download.outcome == 'success' - uses: backstage/actions/pr-automation@d98113056c83b1b0a1293c8310d77d99db4ea22e # v0.7.3 + uses: backstage/actions/pr-automation@d8f699b19b0d328865976ef5f4982dfa97db9952 # v0.7.4 with: app-id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} private-key: ${{ secrets.BACKSTAGE_GOALIE_PRIVATE_KEY }} @@ -51,3 +55,28 @@ jobs: label-added: ${{ steps.context.outputs.label-added }} review-state: ${{ steps.context.outputs.review-state }} actor: ${{ steps.context.outputs.actor }} + action: ${{ steps.context.outputs.action }} + + # Runs when CI or E2E workflows complete to update priority based on check status + update-on-ci: + runs-on: ubuntu-latest + if: > + (github.event.workflow_run.name == 'CI' || github.event.workflow_run.name == 'E2E Linux') && + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.pull_requests[0] + steps: + - name: Harden Runner + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 + with: + egress-policy: audit + + - name: Backstage PR automation + uses: backstage/actions/pr-automation@d8f699b19b0d328865976ef5f4982dfa97db9952 # v0.7.4 + with: + app-id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} + private-key: ${{ secrets.BACKSTAGE_GOALIE_PRIVATE_KEY }} + installation-id: ${{ secrets.BACKSTAGE_GOALIE_INSTALLATION_ID }} + project-owner: backstage + project-number: '14' + pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} + action: synchronize