Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyber OS Lab committed Apr 12, 2023
1 parent 2dadf47 commit 80ca462
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Create change
run: date +%s > report.txt

- name: Create Pull Request
- name: Github Pull Request
id: cpr
uses: ./
with:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
with:
name: dist
path: dist
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cpr-example-command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Pull Request Example Command
name: Github Pull Request Example Command
on:
repository_dispatch:
types: [cpr-example-command]
Expand All @@ -11,7 +11,7 @@ jobs:
- name: Make changes to pull request
run: date +%s > report.txt

- name: Create Pull Request
- name: Github Pull Request
id: cpr
uses: ./
with:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img width="24" height="24" src="docs/assets/logo.svg"> Create Pull Request
# <img width="24" height="24" src="docs/assets/logo.svg"> Github Pull Request

[![CI](https://github.com/cvelab/actions/workflows/CI/badge.svg)](https://github.com/cvelab/actions/actions?query=workflow%3ACI)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Create%20Pull%20Request-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=github)](https://github.com/marketplace/actions/gh-pull-request)
Expand All @@ -9,7 +9,7 @@ Changes to a repository in the Actions workspace persist between steps in a work
This action is designed to be used in conjunction with other steps that modify or add files to your repository.
The changes will be automatically committed to a new branch and a pull request created.

Create Pull Request action will:
Github Pull Request action will:

1. Check for repository changes in the Actions workspace. This includes:
- untracked (new) files
Expand All @@ -31,15 +31,15 @@ Create Pull Request action will:

# Make changes to pull request here

- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```
You can also pin to a [specific release](https://github.com/cvelab/actions/releases) version in the format `@v5.x.x`

### Workflow permissions

For this action to work you must explicitly allow GitHub Actions to create pull requests.
For this action to work you must explicitly allow GitHub Actions to Github Pull Requests.
This setting can be found in a repository's settings under Actions > General > Workflow permissions.

For repositories belonging to an organization, this setting can be managed by admins in organization settings under Actions > General > Workflow permissions.
Expand Down Expand Up @@ -77,7 +77,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
For self-hosted runners behind a corporate proxy set the `https_proxy` environment variable.

```yml
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
env:
https_proxy: http://<proxy_address>:<port>
Expand All @@ -96,7 +96,7 @@ Step outputs can be accessed as in the following example.
Note that in order to read the step outputs the action step must have an id.

```yml
- name: Create Pull Request
- name: Github Pull Request
id: cpr
uses: cvelab/actions@v5
- name: Check outputs
Expand Down Expand Up @@ -160,7 +160,7 @@ Paths should follow git's [pathspec](https://git-scm.com/docs/gitglossary#Docume
File changes that do not match one of the paths will be stashed and restored after the action has completed.

```yml
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
add-paths: |
Expand All @@ -187,7 +187,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
git commit -m "Add untracked file during workflow"
- name: Uncommitted change
run: date +%s > report.txt
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```

Expand All @@ -196,7 +196,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
To create a project card for the pull request, pass the `pull-request-number` step output to [create-or-update-project-card](https://github.com/cvelab/create-or-update-project-card) action.

```yml
- name: Create Pull Request
- name: Github Pull Request
id: cpr
uses: cvelab/actions@v5
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
- name: Make changes to pull request
run: date +%s > report.txt
- name: Create Pull Request
- name: Github Pull Request
id: cpr
uses: cvelab/actions@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Create Pull Request'
name: 'Github Pull Request'
description: 'Creates a pull request for changes to your repository in the actions workspace'
inputs:
token:
Expand Down
14 changes: 7 additions & 7 deletions docs/concepts-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Workflow steps:

The following git diagram shows how the action creates and updates a pull request branch.

![Create Pull Request GitGraph](assets/cpr-gitgraph.png)
![Github Pull Request GitGraph](assets/cpr-gitgraph.png)

## Guidelines

Expand Down Expand Up @@ -144,7 +144,7 @@ Pull requests created by the action using the default `GITHUB_TOKEN` cannot trig

There are a number of workarounds with different pros and cons.

- Use the default `GITHUB_TOKEN` and allow the action to create pull requests that have no checks enabled. Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks. To prevent merging of pull requests without checks erroneously, use [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests).
- Use the default `GITHUB_TOKEN` and allow the action to Github Pull Requests that have no checks enabled. Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks. To prevent merging of pull requests without checks erroneously, use [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests).

- Use a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) created on an account that has write access to the repository that pull requests are being created in. This is the standard workaround and [recommended by GitHub](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow). However, the PAT cannot be scoped to a specific repository so the token becomes a very sensitive secret. If this is a concern, the PAT can instead be created for a dedicated [machine account](https://docs.github.com/en/github/site-policy/github-terms-of-service#3-account-requirements) that has collaborator access to the repository. Also note that because the account that owns the PAT will be the creator of pull requests, that user account will be unable to perform actions such as request changes or approve the pull request.

Expand Down Expand Up @@ -207,7 +207,7 @@ How to use SSH (deploy keys) with gh-pull-request action:
# Make changes to pull request here
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```

Expand Down Expand Up @@ -273,7 +273,7 @@ GitHub App generated tokens are more secure than using a PAT because GitHub App
# Make changes to pull request here
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ steps.generate-token.outputs.token }}
Expand Down Expand Up @@ -315,7 +315,7 @@ The action can use GPG to sign commits with a GPG key that you generate yourself
# Make changes to pull request here
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.PAT }}
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:

# Make changes to pull request here

- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```
Expand All @@ -370,6 +370,6 @@ jobs:

# Make changes to pull request here

- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```
26 changes: 13 additions & 13 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Update AUTHORS
run: |
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
commit-message: update authors
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
run: |
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
branch: production-promotion
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
chmod u+x git-chglog
./git-chglog -o CHANGELOG.md
rm git-chglog
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
commit-message: update changelog
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
run: |
npx -p npm-check-updates ncu -u
npm install
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.PAT }}
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
run: chmod +x gradlew
- name: Perform dependency resolution and write new lockfiles
run: ./gradlew dependencies --write-locks
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.PAT }}
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
cargo install cargo-edit
cargo update
cargo upgrade --to-lockfile
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.PAT }}
Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:
sed -i "s|src=\"./|src=\"dist/|g" index.html
# Update current release
echo ${{ steps.swagger-ui.outputs.release_tag }} > swagger-ui.version
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
commit-message: Update swagger-ui to ${{ steps.swagger-ui.outputs.release_tag }}
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
git remote add upstream https://github.com/owner/repo.git
git fetch upstream main:upstream-main
git reset --hard upstream-main
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
token: ${{ secrets.PAT }}
Expand Down Expand Up @@ -384,7 +384,7 @@ jobs:
--convert-links \
--domains quotes.toscrape.com \
http://quotes.toscrape.com/
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
commit-message: update local website copy
Expand Down Expand Up @@ -480,7 +480,7 @@ jobs:
run: |
branch-name="autopep8-patches/${{ github.head_ref }}"
echo "branch-name=$branch-name" >> $GITHUB_OUTPUT
- name: Create Pull Request
- name: Github Pull Request
if: steps.autopep8.outputs.exit-code == 2
uses: cvelab/actions@v5
with:
Expand Down Expand Up @@ -534,7 +534,7 @@ If you have git hooks that prevent the action from working correctly you can rem
# Remove git hooks
- run: rm -rf .git/hooks
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
```
Expand All @@ -552,7 +552,7 @@ Note that the step where output variables are defined must have an id.
by [gh-pull-request](https://github.com/cvelab/actions)."
echo "pr_title=$pr_title" >> $GITHUB_OUTPUT
echo "pr_body=$pr_body" >> $GITHUB_OUTPUT
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
title: ${{ steps.vars.outputs.pr_title }}
Expand Down Expand Up @@ -580,7 +580,7 @@ The template is rendered using the [render-template](https://github.com/chuhlomi
foo: this
bar: that
- name: Create Pull Request
- name: Github Pull Request
uses: cvelab/actions@v5
with:
body: ${{ steps.template.outputs.result }}
Expand Down

0 comments on commit 80ca462

Please sign in to comment.