mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00

* changelog * add actions * add tools * typo * add some debug * pulls vs push * fire on pullr only * test port part 1 * part 2 * part 3 * part 4 * fix double run slow * clean up * update types * reg workflow * reg workflow
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
|
---
|
|
name: get-pull-number
|
|
description: Get Pull Number
|
|
inputs:
|
|
owner:
|
|
type: string
|
|
repo:
|
|
type: string
|
|
sha:
|
|
type: string
|
|
pull-number:
|
|
default: null
|
|
|
|
outputs:
|
|
number:
|
|
value: ${{ steps.get-pull-number.outputs.number }}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Get Pull Number
|
|
id: get-pull-number
|
|
shell: bash
|
|
env:
|
|
GITHUB_OWNER: ${{ inputs.owner }}
|
|
GITHUB_REPO: ${{ inputs.repo }}
|
|
GITHUB_SHA: ${{ inputs.sha }}
|
|
GITHUB_PULL_NUMBER: ${{ inputs.pull-number }}
|
|
run: |
|
|
if [ -z "$GITHUB_PULL_NUMBER" ]
|
|
then
|
|
echo "Searching For Pull Number"
|
|
echo $GITHUB_OWNER
|
|
echo $GITHUB_REPO
|
|
echo $GITHUB_SHA
|
|
pulls=$(gh api repos/$GITHUB_OWNER/$GITHUB_REPO/commits/$GITHUB_SHA/pulls)
|
|
echo $pulls
|
|
full_name=$GITHUB_OWNER/$GITHUB_REPO
|
|
number=$(jq -c --arg r "$full_name" '[.[] | select(.url | contains($r))][0].number' <<< $pulls )
|
|
else
|
|
echo "Given Pull Number"
|
|
number=$GITHUB_PULL_NUMBER
|
|
fi
|
|
echo $number
|
|
echo "number=$number" >> "$GITHUB_OUTPUT"
|