Skip to content

cssnr/create-pull-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Tag Major GitHub Tag Minor GitHub Release Version GitHub Dist Size Workflow Release Workflow Test Workflow Lint Quality Gate Status GitHub Last Commit Codeberg Last Commit GitHub Contributors GitHub Repo Size GitHub Top Language GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

Create Pull Action

Create Pull Action

Easily create a Pull Request from a GitHub Action.

This action assumes you have already created a commit in a head branch. All the other Inputs have defaults.

- name: 'Create Pull'
  uses: cssnr/create-pull-action@master
  with:
    head: feature-branch

See the Inputs for more options.

Features

🚀 Created as an alternative to using the gh cli or api.

  • Simple
  • Defaults

Inputs

âś… Only the head branch is required.

Input Default Value Input Description
repository github.repository Repository owner/name
head Required Head Branch
base default_branch Base Branch
title Changes from {Name} Pull Request Title
body Triggered by {user} in workflow {Name}. Pull Request Body
token github.token Token for repository
summary true Add Job Summary
- name: 'Create Pull'
  uses: cssnr/create-pull-action@master
  with:
    repository: some/other-repository # optional
    head: feature-branch
    base: master # optional
    title: Ralf Broke It # optional
    body: Broken ${{ github.run_number }} times. # optional
    token: ${{ secrets.ACCESS_TOKEN }} # see permissions

Permissions

đź”’ This action requires the following workflow permissions if the repository is the same.

permissions:
  pull-request: write

If the workflow is in a different repository you need to create an Access Token.

The Personal, Fine-Grained or App Token needs these permissions on the repository.

permissions:
  pull-request: write
  contents: read # to determine base branch if private

Permissions documentation for Workflows, Actions and Apps.

Outputs

📤 The pull request response data is accessible via outputs.

Output Description
pull Pull Request JSON
html_url Pull Request HTML URL
id Pull Request ID
number Pull Request Number

Everything is available in the pull json. The other outputs are parsed from this object.

- name: 'Create Pull Action'
  id: pull
  uses: cssnr/create-pull-action@master
  with:
    head: feature-branch

- name: 'Echo Output'
  run: |
    echo "html_url: ${{ steps.pull.outputs.html_url }}"
    echo "html_url: ${{ fromJSON(steps.pull.outputs.pull).html_url }}"

Tags

The following rolling tags are maintained.

Version Tag Rolling Bugs Feat. Name Target Example
GitHub Tag Major âś… âś… âś… Major vN.x.x vN
GitHub Tag Minor ✅ ✅ ❌ Minor vN.N.x vN.N
GitHub Release ❌ ❌ ❌ Micro vN.N.N vN.N.N

You can view the release notes for each version on the releases page.

The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.

Support

If you run into any issues or need help getting started, please do one of the following:

Features Issues Discussions Discord

For more information, see the CSSNR SUPPORT.md.

Contributing

If you would like to submit a PR, please review the CONTRIBUTING.md.

Please consider making a donation to support the development of this project and additional open source projects.

Ko-fi

Actions Tools

Additionally, you can support other GitHub Actions I have published:

âť” Unpublished Actions

These actions are not published on the Marketplace, but may be useful.


📝 Template Actions

These are basic action templates that I use for creating new actions.

Note: The docker-test-action builds, runs and pushes images to GitHub Container Registry.


For a full list of current projects visit: https://cssnr.github.io/

About

Easily create a Pull Request from a GitHub Action.

Topics

Resources

License

Contributing

Stars

Watchers

Forks