Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lablnet/create-branch-from-tag
This action will create a new branch from a tag.
https://github.com/lablnet/create-branch-from-tag
action automation branch free open-source release tags
Last synced: about 1 month ago
JSON representation
This action will create a new branch from a tag.
- Host: GitHub
- URL: https://github.com/lablnet/create-branch-from-tag
- Owner: lablnet
- License: mit
- Created: 2022-05-29T03:38:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T04:19:35.000Z (8 months ago)
- Last Synced: 2024-11-13T14:54:43.426Z (about 2 months ago)
- Topics: action, automation, branch, free, open-source, release, tags
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/create-a-branch
- Size: 5.52 MB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# create-branch-from-tag
This action will create a new branch from a tag.
This GitHub Action (written in JavaScript) wraps the [GitHub Branches API](https://docs.github.com/en/rest/branches/).
## Usage
### Pre-requisites
Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow---create-a-release) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).### Inputs
- `tag_name`: The name of the tag for this release
- `owner`: The name of the owner of the repo. Used to identify the owner of the repository. Used when cutting releases for external repositories. Default: Current owner
- `repo`: The name of the repository. Used to identify the repository on which to release. Used when cutting releases for external repositories. Default: Current repository
- `description`: custom prefix for creating the branch. Default: `release@`### Outputs
- `branch_name`: The Branch Name
- `branch_url`: The URL users can navigate to in order to view the branch.### Example workflow - create a release
On every `push` to a tag matching the pattern `v*`:```yaml
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10name: Create Branch
jobs:
build:
permissions: # Read more at : https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
contents: write
name: Create Branch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Create Branch
id: create_branch
uses: lablnet/create-branch-from-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
owner: ${{ github.repository_owner }} # https://docs.github.com/en/actions/learn-github-actions/contexts#example-contents-of-the-github-context
repo: ${{ github.event.repository.name }} # https://www.reddit.com/r/github/comments/tjkj6f/get_repo_name_on_github_actions_without_owner/
```This will create a [Branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository#creating-a-branch), This uses the `GITHUB_TOKEN` provided by the [virtual environment](https://help.github.com/en/github/automating-your-workflow-with-github-actions/virtual-environments-for-github-actions#github_token-secret), so no new token is needed.
## Contributing
We would love you to contribute to `@lablnet/create-branch-from-tag`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)