build-support/vm: don't depend on the "unix" module (#375355)
[NixPkgs.git] / .github / workflows / get-merge-commit.yml
bloba32595ae1ad443dbfcd7e6fe2f38e8567ae24062
1 name: Get merge commit
3 on:
4   workflow_call:
5     outputs:
6       mergedSha:
7         description: "The merge commit SHA"
8         value: ${{ jobs.resolve-merge-commit.outputs.mergedSha }}
10 permissions: {}
12 jobs:
13   resolve-merge-commit:
14     runs-on: ubuntu-24.04
15     outputs:
16       mergedSha: ${{ steps.merged.outputs.mergedSha }}
17     steps:
18       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19         with:
20           path: base
21           sparse-checkout: ci
23       - name: Check if the PR can be merged and get the test merge commit
24         id: merged
25         env:
26           GH_TOKEN: ${{ github.token }}
27           GH_EVENT: ${{ github.event_name }}
28         run: |
29           case "$GH_EVENT" in
30             push)
31               echo "mergedSha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
32               ;;
33             pull_request_target)
34               if mergedSha=$(base/ci/get-merge-commit.sh ${{ github.repository }} ${{ github.event.number }}); then
35                 echo "Checking the merge commit $mergedSha"
36                 echo "mergedSha=$mergedSha" >> "$GITHUB_OUTPUT"
37               else
38                 # Skipping so that no notifications are sent
39                 echo "Skipping the rest..."
40               fi
41               ;;
42           esac
43           rm -rf base