Skip to content

Commit

Permalink
[Dependencies] - Update .github/workflows/pull-request.yml to match t…
Browse files Browse the repository at this point in the history
…he template repo
  • Loading branch information
credfeto committed Oct 9, 2023
1 parent b961a40 commit 2712504
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

env:
HEAD_REF: ${{github.head_ref}}
BASE_REF: ${{github.base_ref}}
REPO: ${{github.repository}}"
REPO_OWNER: ${{github.repository_owner}}"

jobs:
info:
runs-on: ubuntu-latest
Expand All @@ -25,8 +31,8 @@ jobs:
- run: |
echo "Branch: ${{env.HEAD_REF}}"
echo "Base Branch: ${{env.BASE_REF}}"
echo "Repo: ${{github.repository}}"
echo "Owner: ${{github.repository_owner}}"
echo "Repo: ${{env.REPO}}"
echo "Owner: ${{env.REPO_OWNER}}"
pull-request:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,7 +60,7 @@ jobs:
if: steps.findPr.outputs.number != ''
run: |
echo "Pull request already exists with id: ${{steps.findPr.outputs.number}}"
echo "URL: https://github.com/${{github.repository}}/pull/${{steps.findPr.outputs.number}}"
echo "URL: https://github.com/${{env.REPO}}/pull/${{steps.findPr.outputs.number}}"
- name: "Read PR Template"
if: steps.findPr.outputs.number == ''
Expand All @@ -67,23 +73,29 @@ jobs:
if: steps.findPr.outputs.number == ''
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B)" >> "$GITHUB_ENV"

- name: "Check Owner"
if: github.repository_owner != 'funfair-tech'
run: |
echo "Current Owner: ${{github.repository_owner}}"
- name: "Check Repo Visibility"
if: steps.findPr.outputs.number != '' && github.repository_owner != 'funfair-tech'
if: steps.findPr.outputs.number != ''
uses: credfeto/[email protected]
id: visibility
with:
repository: ${{github.repository}}
repository: ${{env.REPO}}
token: ${{secrets.GITHUB_TOKEN}}

- name: "Override DRAFT Flag"
if: steps.findPr.outputs.number != '' && github.repository_owner != 'funfair-tech' && env.REPO_STATUS == 'private'
if: |-
steps.findPr.outputs.number != ''
&& env.REPO_OWNER != 'funfair-tech'
&& env.REPO_STATUS == 'private'
run: echo "CREATE_DRAFT=false" >> "$GITHUB_ENV"

- name: "Status"
run: |
echo "Repo: ${{env.REPO}}"
echo "Owner: ${{env.REPO_OWNER}}"
echo "Repo Status: ${{env.REPO_STATUS}}"
echo "Draft: ${{env.CREATE_DRAFT}}"
- name: "Create Pull Request"
if: steps.findPr.outputs.number == ''
id: open-pr
Expand Down

0 comments on commit 2712504

Please sign in to comment.