Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
4c95214a9b | |||
b37c0a038c | |||
d9841567d1 | |||
2cce94bfb0 | |||
d968e8b11b | |||
6c73093f9b | |||
d17c882ef3 | |||
d5f4e48a66 |
@ -46,7 +46,7 @@ These inputs are *all optional*. If not set, sensible default values will be use
|
||||
| `team-reviewers` | A comma separated list of GitHub teams to request a review from. | none |
|
||||
| `milestone` | The number of the milestone to associate this pull request with. | none |
|
||||
| `branch` | The branch name. See **Branch naming** below for details. | `create-pull-request/patch` |
|
||||
| `base` | Overrides the base branch. **Use with caution!** | Defaults to the currently checked out branch. |
|
||||
| `base` | Sets the pull request base branch. | Defaults to the currently checked out branch, `GITHUB_REF`. For `pull_request` events, `GITHUB_HEAD_REF` |
|
||||
| `branch-suffix` | The branch suffix type. Valid values are `short-commit-hash`, `timestamp`, `random` and `none`. See **Branch naming** below for details. | `short-commit-hash` |
|
||||
|
||||
**Outputs**
|
||||
|
@ -27,7 +27,7 @@ inputs:
|
||||
branch:
|
||||
description: 'The pull request branch name.'
|
||||
base:
|
||||
description: 'Overrides the base branch.'
|
||||
description: 'Sets the pull request base branch.'
|
||||
branch-suffix:
|
||||
description: 'The branch suffix type.'
|
||||
outputs:
|
||||
|
6
dist/src/create-pull-request.py
vendored
6
dist/src/create-pull-request.py
vendored
@ -217,9 +217,13 @@ elif github_ref.startswith('refs/pull/'):
|
||||
"Removing the merge commit by switching to the pull request head branch '%s'" %
|
||||
base)
|
||||
checkout_branch(repo.git, True, base)
|
||||
else:
|
||||
elif github_ref.startswith('refs/heads/'):
|
||||
base = github_ref[11:]
|
||||
print("Currently checked out base assumed to be branch '%s'" % base)
|
||||
else:
|
||||
print(f"::warning::Currently checked out ref '{github_ref}' is not a valid base for a pull request. " +
|
||||
"Unable to continue. Exiting.")
|
||||
sys.exit()
|
||||
|
||||
# Skip if the current branch is a PR branch created by this action.
|
||||
# This may occur when using a PAT instead of GITHUB_TOKEN because
|
||||
|
2
dist/src/requirements.txt
vendored
2
dist/src/requirements.txt
vendored
@ -1,2 +1,2 @@
|
||||
GitPython==3.0.4
|
||||
GitPython==3.0.5
|
||||
PyGithub==1.44.1
|
||||
|
61
examples.md
61
examples.md
@ -336,39 +336,42 @@ Alternatively, [`set-env`](https://help.github.com/en/github/automating-your-wor
|
||||
|
||||
### Debugging GitHub Actions
|
||||
|
||||
#### Runner Diagnostic Logging
|
||||
|
||||
[Runner diagnostic logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-runner-diagnostic-logging) provides additional log files that contain information about how a runner is executing an action.
|
||||
To enable runner diagnostic logging, set the secret `ACTIONS_RUNNER_DEBUG` to `true` in the repository that contains the workflow.
|
||||
|
||||
#### Step Debug Logging
|
||||
|
||||
To enable [step debug logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-step-debug-logging) set the secret `ACTIONS_STEP_DEBUG` to `true` in the repository that contains the workflow.
|
||||
[Step debug logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-step-debug-logging) increases the verbosity of a job's logs during and after a job's execution.
|
||||
To enable step debug logging set the secret `ACTIONS_STEP_DEBUG` to `true` in the repository that contains the workflow.
|
||||
|
||||
#### Output Various Contexts
|
||||
|
||||
```yml
|
||||
- name: Dump event JSON
|
||||
env:
|
||||
EVENT_JSON_FILENAME: ${{ github.event_path }}
|
||||
run: cat "$EVENT_JSON_FILENAME"
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "$GITHUB_CONTEXT"
|
||||
- name: Dump job context
|
||||
env:
|
||||
JOB_CONTEXT: ${{ toJson(job) }}
|
||||
run: echo "$JOB_CONTEXT"
|
||||
- name: Dump steps context
|
||||
env:
|
||||
STEPS_CONTEXT: ${{ toJson(steps) }}
|
||||
run: echo "$STEPS_CONTEXT"
|
||||
- name: Dump runner context
|
||||
env:
|
||||
RUNNER_CONTEXT: ${{ toJson(runner) }}
|
||||
run: echo "$RUNNER_CONTEXT"
|
||||
- name: Dump strategy context
|
||||
env:
|
||||
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
|
||||
run: echo "$STRATEGY_CONTEXT"
|
||||
- name: Dump matrix context
|
||||
env:
|
||||
MATRIX_CONTEXT: ${{ toJson(matrix) }}
|
||||
run: echo "$MATRIX_CONTEXT"
|
||||
steps:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "$GITHUB_CONTEXT"
|
||||
- name: Dump job context
|
||||
env:
|
||||
JOB_CONTEXT: ${{ toJson(job) }}
|
||||
run: echo "$JOB_CONTEXT"
|
||||
- name: Dump steps context
|
||||
env:
|
||||
STEPS_CONTEXT: ${{ toJson(steps) }}
|
||||
run: echo "$STEPS_CONTEXT"
|
||||
- name: Dump runner context
|
||||
env:
|
||||
RUNNER_CONTEXT: ${{ toJson(runner) }}
|
||||
run: echo "$RUNNER_CONTEXT"
|
||||
- name: Dump strategy context
|
||||
env:
|
||||
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
|
||||
run: echo "$STRATEGY_CONTEXT"
|
||||
- name: Dump matrix context
|
||||
env:
|
||||
MATRIX_CONTEXT: ${{ toJson(matrix) }}
|
||||
run: echo "$MATRIX_CONTEXT"
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-pull-request",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"description": "Creates a pull request for changes to your repository in the actions workspace",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -217,9 +217,13 @@ elif github_ref.startswith('refs/pull/'):
|
||||
"Removing the merge commit by switching to the pull request head branch '%s'" %
|
||||
base)
|
||||
checkout_branch(repo.git, True, base)
|
||||
else:
|
||||
elif github_ref.startswith('refs/heads/'):
|
||||
base = github_ref[11:]
|
||||
print("Currently checked out base assumed to be branch '%s'" % base)
|
||||
else:
|
||||
print(f"::warning::Currently checked out ref '{github_ref}' is not a valid base for a pull request. " +
|
||||
"Unable to continue. Exiting.")
|
||||
sys.exit()
|
||||
|
||||
# Skip if the current branch is a PR branch created by this action.
|
||||
# This may occur when using a PAT instead of GITHUB_TOKEN because
|
||||
|
@ -1,2 +1,2 @@
|
||||
GitPython==3.0.4
|
||||
GitPython==3.0.5
|
||||
PyGithub==1.44.1
|
||||
|
Reference in New Issue
Block a user