Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Release temp #37

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
26 changes: 26 additions & 0 deletions .github/workflows/temp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- temp
jobs:
pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Check For PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REF: ${{ env.GITHUB_BASE_REF }}
BASE: master
run: |
BRANCH=${GITHUB_REF##*/}
echo "Check If PR exists for $BRANCH"
gh pr list -R "$GITHUB_REPOSITORY" --base "$BASE" --state open --label "Release $BRANCH"
if [[ "$(gh pr list -R "$GITHUB_REPOSITORY" --base "$BASE" --state open --label "Release $BRANCH")" == "" ]]; then
echo "Creating PR repos/"${GITHUB_REPOSITORY}"/pulls"
RESULT=$(gh api repos/"${GITHUB_REPOSITORY}"/pulls -F head="$BRANCH" -F base="$BASE" -F title="Release $BRANCH")
PR_NUM=$(echo $RESULT | jq -r '.number')
echo "PR Number: $PR_NUM"
printf '{"labels": ["Release %s"]}' $BRANCH | gh api repos/"${GITHUB_REPOSITORY}"/issues/"${PR_NUM}"/labels --input -
fi