Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
# Order is important: the last matching pattern has the highest precedence

# These owners will be the default owners for everything
* @cloudposse/engineering @cloudposse/contributors
* @cloudposse-github-actions/engineering @cloudposse-github-actions/engineering/contributors

# Cloud Posse must review any changes to Makefiles
**/Makefile @cloudposse/engineering
**/Makefile.* @cloudposse/engineering
**/Makefile @cloudposse-github-actions/engineering
**/Makefile.* @cloudposse-github-actions/engineering

# Cloud Posse must review any changes to GitHub actions
.github/* @cloudposse/engineering
.github/* @cloudposse-github-actions/engineering

# Cloud Posse must review any changes to standard context definition,
# but some changes can be rubber-stamped.
**/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
**/*.tf @cloudposse-github-actions/engineering @cloudposse-github-actions/contributors
README.yaml @cloudposse-github-actions/engineering @cloudposse-github-actions/contributors
README.md @cloudposse-github-actions/engineering @cloudposse-github-actions/contributors
docs/*.md @cloudposse-github-actions/engineering @cloudposse-github-actions/contributors

# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
.github/mergify.yml @cloudposse/admins
.github/CODEOWNERS @cloudposse/admins
.github/mergify.yml @cloudposse-github-actions/admins
.github/CODEOWNERS @cloudposse-github-actions/admins
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: "yarn"

- name: Install Dependencies
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ jobs:
validate-codeowners:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v4
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
with:
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
# checks: "files,syntax,owners,duppatterns"
checks: "syntax,owners,duppatterns"
owner_checker_allow_unowned_patterns: "false"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
with:
checks: "syntax,duppatterns"
owner_checker_allow_unowned_patterns: "false"
- name: "Checkout source code at current commit"
uses: actions/checkout@v4
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
with:
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
# checks: "files,syntax,owners,duppatterns"
checks: "syntax,owners,duppatterns"
owner_checker_allow_unowned_patterns: "false"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
with:
checks: "syntax,duppatterns"
owner_checker_allow_unowned_patterns: "false"
113 changes: 93 additions & 20 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
#

# Name of this project
name: github-action-typescript-template
name: Create Branch from a Specific Tag

# Tags of this project
tags:
- github-action
- typescript
- template

# Logo for this project
#logo: docs/logo.png
Expand All @@ -20,39 +19,113 @@ tags:
license: "APACHE2"

# Canonical GitHub repo
github_repo: cloudposse/github-action-typescript-template
github_repo: cloudposse-github-actions/create-branch-from-tag

# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/github-action-typescript-template.svg"
url: "https://github.com/cloudposse/github-action-typescript-template/releases/latest"
image: "https://img.shields.io/github/release/cloudposse-github-actions/create-branch-from-tag.svg"
url: "https://github.com/cloudposse-github-actions/create-branch-from-tag/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"

related: []

# Short description of this project
description: Template repo for GitHub Actions written in TypeScript
description: This action creates a new branch from a specific tag.

introduction: |-
This repo is a template for GitHub Actions written in TypeScript.
references:
- name: "github-actions-workflows"
description: "Reusable workflows for different types of projects"
url: "https://github.com/cloudposse/github-actions-workflows"
- name: "example-github-action-release-workflow"
description: "Example application with complicated release workflow"
url: "https://github.com/cloudposse/example-github-action-release-workflow"
This action creates a new branch from a specific tag.

This is a fork of [satya-500's create a branch from a tag action](https://github.com/satya-500/create-branch-from-tag)

#references:
# - name: "github-actions-workflows"
# description: "Reusable workflows for different types of projects"
# url: "https://github.com/cloudposse/github-actions-workflows"
# - name: "example-github-action-release-workflow"
# description: "Example application with complicated release workflow"
# url: "https://github.com/cloudposse/example-github-action-release-workflow"

# How to use this project
usage: |
Use this repository as a template in your own GitHub Action project to get started.

include:
create branch from tag
```yaml
- name: creating rc branch
uses: cloudposse-github-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: release
tag: tags/v0.0.7
```

create branch from specific ref (branch)
```yaml
- name: creating rc branch
uses: cloudposse-github-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: release
tag: test
```

# Contributors to this project
contributors:
- name: "Matt Calhoun"
github: "mcalhoun"
Full Job Example (Workflow Dispatch as a shared reusable workflow)
```yaml
on:
workflow_call:
inputs:
runs-on:
description: "The runner labels on which jobs should run on"
required: false
type: string
default: '["self-hosted"]'
organization:
description: "Repository owner organization (e.g. 'acme' for repo acme/example)"
required: true
type: string
repository:
description: "Repository name (e.g. 'example' for repo acme/example)"
required: true
type: string
tag:
description: "The semantic version tag of the release (e.g. 'v1.1.0')"
required: true
type: string
outputs:
branch-name:
description: "Branch name"
value: ${{ jobs.create-branch.outputs.branch-name }}

permissions:
id-token: write
contents: write

jobs:
create-branch:
name: build
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Parse Semver
id: parse-semver
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: ${{ inputs.tag }}

- name: Create Release Branch
uses: cloudposse-github-actions/create-branch-from-tag@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The following can easily just be 'release/${{ inputs.tag }}', however it is left as is
# in case the tag needs to be manipulated. For example:
# 'release/${{ steps.parse-semver.outputs.major }}.${{ steps.parse-semver.outputs.minor }}.x'
branch: release/${{ steps.parse-semver.outputs.fullversion }}
from: tags/${{ inputs.tag }}
```
17 changes: 12 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: "github-actions-typescript-template"
description: "A template for creating GitHub Actions in TypeScript"
name: 'Create Branch From a Specific Tag'
description: 'Create Branch From Specific Tag'
author: "Cloud Posse"

inputs:
milliseconds:
branch:
description: 'The branch to create'
default: 'release'
from:
description: 'Provide the tag number ex:- v0.0.7 or branch name i.e develop'
required: true
description: "input description here"
default: "200"

runs:
using: "node20"
main: "dist/index.js"
branding:
icon: 'git-branch'
color: 'black'
Loading
Loading