workflows/test: run push job on correct commit

Previously, the test for the push workflow was running on the HEAD
commit of the PR only. It would be better to run it on the merged result
instead, just like any other tests we run in a PR.
This commit is contained in:
Wolfgang Walther
2025-08-22 14:44:48 +02:00
parent 443f30f811
commit 06a0eba240
2 changed files with 25 additions and 1 deletions

View File

@@ -10,6 +10,10 @@ on:
- staging-* - staging-*
- haskell-updates - haskell-updates
workflow_call: workflow_call:
inputs:
mergedSha:
required: true
type: string
secrets: secrets:
CACHIX_AUTH_TOKEN: CACHIX_AUTH_TOKEN:
required: true required: true
@@ -43,5 +47,5 @@ jobs:
secrets: secrets:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
with: with:
mergedSha: ${{ github.sha }} mergedSha: ${{ inputs.mergedSha || github.sha }}
systems: ${{ needs.prepare.outputs.systems }} systems: ${{ needs.prepare.outputs.systems }}

View File

@@ -13,9 +13,27 @@ jobs:
prepare: prepare:
runs-on: ubuntu-24.04-arm runs-on: ubuntu-24.04-arm
outputs: outputs:
mergedSha: ${{ steps.prepare.outputs.mergedSha }}
pr: ${{ steps.files.outputs.pr }} pr: ${{ steps.files.outputs.pr }}
push: ${{ steps.files.outputs.push }} push: ${{ steps.files.outputs.push }}
steps: steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
sparse-checkout-cone-mode: true # default, for clarity
sparse-checkout: |
ci/github-script
- id: prepare
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
require('./ci/github-script/prepare.js')({
github,
context,
core,
// Review comments will be posted by the main PR workflow on the pull_request_target event.
dry: false,
})
- name: Determine changed files - name: Determine changed files
id: files id: files
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -70,3 +88,5 @@ jobs:
statuses: write statuses: write
secrets: secrets:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
with:
mergedSha: ${{ needs.prepare.outputs.mergedSha }}