mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

This is a refactor to prepare the next commit. It doesn't do much on its own, but is separated for ease of review.
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: Get merge commit
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
mergedSha:
|
|
description: "The merge commit SHA"
|
|
value: ${{ jobs.resolve-merge-commit.outputs.mergedSha }}
|
|
systems:
|
|
description: "The supported systems"
|
|
value: ${{ jobs.resolve-merge-commit.outputs.systems }}
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
resolve-merge-commit:
|
|
runs-on: ubuntu-24.04-arm
|
|
outputs:
|
|
mergedSha: ${{ steps.merged.outputs.mergedSha }}
|
|
systems: ${{ steps.systems.outputs.systems }}
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
path: base
|
|
sparse-checkout: ci
|
|
|
|
- name: Check if the PR can be merged and get the test merge commit
|
|
id: merged
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_EVENT: ${{ github.event_name }}
|
|
run: |
|
|
case "$GH_EVENT" in
|
|
push)
|
|
echo "mergedSha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
|
|
;;
|
|
pull_request_target)
|
|
if mergedSha=$(base/ci/get-merge-commit.sh ${{ github.repository }} ${{ github.event.number }}); then
|
|
echo "Checking the merge commit $mergedSha"
|
|
echo "mergedSha=$mergedSha" >> "$GITHUB_OUTPUT"
|
|
else
|
|
# Skipping so that no notifications are sent
|
|
echo "Skipping the rest..."
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
- name: Load supported systems
|
|
id: systems
|
|
run: |
|
|
echo "systems=$(jq -c <base/ci/supportedSystems.json)" >> "$GITHUB_OUTPUT"
|