Skip to content

Commit

Permalink
MNT Add auto-tag workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 1, 2022
1 parent d9bf58b commit 0910495
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Auto-tag
on:
push:
tags:
- '*.*.*'
jobs:
auto-tag:
name: Auto-tag
runs-on: ubuntu-latest
steps:
- name: Auto-tag
uses: silverstripe/gha-auto-tag@main
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# GitHub Actions - Pull request

Create a new branch, makes a commit and a creates a pull-request using with a github-actions user as the author
Create a new branch, makes a commit and a creates a pull-request using with a github-actions user as the author. These will be created on the account/repo that called the actions.

This will be created on the account/repo that called the actions, it will not create a pull-request in a forked repo.
## Usage

**workflow.yml**
```yml
steps:
- name: Create pull-request
uses: silverstripe/gha-pull-request@main
with:
branch: pulls/4/my-branch
title: NEW My pull-request title
description: This pull-request does great things
```
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Branch commit and pull-request
description: GitHub Action to create a branch, commit and a pull-request as the github-actions user

inputs:
branch:
type: string
Expand All @@ -11,9 +12,11 @@ inputs:
type: string
required: false
default: ''

runs:
using: composite
steps:

- name: Validate branch
shell: bash
env:
Expand All @@ -37,6 +40,9 @@ runs:
TITLE: ${{ inputs.title }}
DESCRIPTION: ${{ inputs.description }}
run: |
# Escape double quotes '"' => '\"'
TITLE=${TITLE//\"/\\\"}
DESCRIPTION=${DESCRIPTION//\"/\\\"}
BASE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Run git commit, push and create pull-request as 'github-actions' user
git config --local user.name "github-actions"
Expand Down

0 comments on commit 0910495

Please sign in to comment.