-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dependencies] - Update .github/workflows/pull-request.yml to match t…
…he template repo
- Loading branch information
Showing
1 changed file
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 == '' | ||
|
@@ -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 | ||
|