4 Commits

Author SHA1 Message Date
vsoch
2ca266185d updating changelog preparing for release
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-04-18 19:54:26 -06:00
Max Anderson
e2a437cdbd Prevent unhandled exception when running via schedule (#69)
* Prevent unhandled exception when running via schedule
2021-04-18 19:53:12 -06:00
Vanessasaurus
2d5c80f215 dont use version for examples, stick to master (#67)
* dont use version for examples, stick to master
* add note about it being important to use stable release in README.md

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-03-27 19:08:35 -06:00
Vanessasaurus
7f0d383d15 adding back assignees variable (#65)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-02-15 10:51:43 -07:00
10 changed files with 19 additions and 13 deletions

View File

@@ -14,6 +14,8 @@ represented by the pull requests that fixed them. Critical items to know are:
Versions correspond with GitHub releases that can be referenced with @ using actions.
## [master](https://github.com/vsoch/pull-request-action/tree/master) (master)
- bugfix of missing from branch with scheduled run (1.0.16)
- forgot to add assignees (1.0.15)
- output and environment variables for PR number and return codes (1.0.5)
- added support for reviewer (individual and team) assignments (1.0.4)
- added support for maintainer can modify and assignees (1.0.3)

View File

@@ -22,13 +22,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.6
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"
PULL_REQUEST_BRANCH: "master"
```
**Important**: Make sure to use a stable [release](https://github.com/vsoch/pull-request-action/releases) instead of a branch for your workflow.
## Environment Variable Inputs
Unlike standard actions, this action just uses variables from the environment.
@@ -114,7 +117,7 @@ jobs:
PR_BRANCH_FROM=release-v$(cat VERSION)
export "PULL_REQUEST_FROM_BRANCH=${PR_BRANCH_FROM}" >> $GITHUB_ENV
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.6
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "master"

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.3
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"

View File

@@ -43,7 +43,7 @@ jobs:
echo "PULL_REQUEST_FROM_BRANCH=${BRANCH_FROM}" >> $GITHUB_ENV
- name: Open Pull Request
uses: vsoch/pull-request-action@1.0.6
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "master"

View File

@@ -47,7 +47,7 @@ jobs:
- name: Set PR body
run: echo "PULL_REQUEST_BODY=${{steps.set-pr-body.outputs.result}}" >> $GITHUB_ENV
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.10
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "hotfix-"

View File

@@ -10,7 +10,7 @@ jobs:
steps:
- name: pull-request-action
id: pull_request
uses: vsoch/pull-request-action@1.0.6
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: pull-request-action
uses: vsoch/pull-request-action@add/support-null-branch
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"

View File

@@ -39,7 +39,7 @@ jobs:
git push --force "https://${{ github.actor }}:${{secrets.GITHUB_TOKEN}}@github.com/${{ github.repository }}.git" "HEAD:${{ steps.data.outputs.suite_update_branch }}"
- name: Open a PR to the default branch
uses: vsoch/pull-request-action@1.0.2
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_FROM_BRANCH: "${{ steps.data.outputs.suite_update_branch }}"

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.4
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"

View File

@@ -188,11 +188,12 @@ def list_pull_requests(target, source):
return response.json()
def add_assignees(entry):
def add_assignees(entry, assignees):
"""Given a pull request metadata (from create or update) add assignees
Parameters:
entry (dict) : the pull request metadata
entry (dict) : the pull request metadata
assignees (str) : comma separated assignees string set by action
"""
# Remove leading and trailing quotes
assignees = parse_into_list(assignees)
@@ -320,7 +321,7 @@ def create_pull_request(
# If we have opened or updated, we can add assignees
if response and assignees:
add_assignees(response)
add_assignees(response, assignees)
if response and (reviewers or team_reviewers):
add_reviewers(response, reviewers, team_reviewers)
@@ -393,7 +394,7 @@ def main():
if not from_branch:
print("PULL_REQUEST_FROM_BRANCH is not set, checking branch in payload.")
with open(check_events_json(), "r") as fd:
from_branch = json.loads(fd.read()).get("ref")
from_branch = json.loads(fd.read()).get("ref", "")
from_branch = from_branch.replace("refs/heads/", "").strip("/")
else:
print("PULL_REQUEST_FROM_BRANCH is set.")