Skip to content

Commit

Permalink
Merge pull request #6 from wayfair/add-forker-workflow
Browse files Browse the repository at this point in the history
⑂ Add forker workflow
  • Loading branch information
lelia authored Apr 20, 2022
2 parents ff252fc + d2f4bb1 commit 3ab01c1
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: fork

on: # Only trigger on manual input
workflow_dispatch:
inputs:
owner:
description: 'Owner of GitHub repo to be forked'
required: true
repo:
description: 'GitHub repo to be forked'
required: true
org:
description: 'GitHub org to fork the repo into'
required: true
default: wayfair-contribs
user:
description: 'GitHub user requesting the fork'
required: true
addUser:
description: 'Add GitHub user to org if missing?'
required: true
default: true

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: wayfair-incubator/forker@releases/v0.0.4
name: "⑂ fork request"
with:
# Enforce current list of OSPO-approved licenses
licenseAllowlist: "0bsd\napache-2.0\nbsd-2-clause\nbsd-3-clause\nmit"
# Using API token for lhasa-ospo service account
token: ${{ secrets.OSPO_API_TOKEN }}
# Manual user inputs from workflow dispatch
repo: ${{ github.event.inputs.repo }}
owner: ${{ github.event.inputs.owner }}
org: ${{ github.event.inputs.org }}
user: ${{ github.event.inputs.user }}
addUser: ${{ github.event.inputs.addUser }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: # Rebuild any PRs and main branch changes
branches:
- main
pull_request:
workflow_dispatch:

jobs:
lint:
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.3] - 2022-04-20

- Added manual `fork.yml` workflow for repository forks
- Updated README to include workflow usage instructions

## [0.0.2] - 2022-04-11

### Added
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ and fix existing bugs. Here is what you can do:

- Help ensure that existing issues follows the recommendations from the _[Reporting Issues](#reporting-issues)_ section,
providing feedback to the issue's author on what might be missing.
- Review and update the existing content of our [Wiki](https://github.com/wayfair/ospo-automation/wiki) with up-to-date
instructions and code samples.
- Review existing pull requests, and testing patches against real existing applications that use OSPO Automation.
- Write a test, or add a missing test case to an existing test.

Expand Down
43 changes: 18 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OSPO Automation

[![Release](https://img.shields.io/badge/release-v0.0.2-blue.svg)](CHANGELOG.md)
[![Lint](https://github.com/wayfair/ospo-automation/actions/workflows/ci/lint.yml/badge.svg?branch=main)](https://github.com/wayfair/ospo-automation/actions/workflows/ci/lint.yml)
[![Release](https://img.shields.io/badge/release-v0.0.3-blue.svg)](CHANGELOG.md)
[![Lint](https://github.com/wayfair/ospo-automation/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/wayfair/ospo-automation/actions/workflows/lint.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-orange.svg)](LICENSE)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![Maintainer](https://img.shields.io/badge/Maintainer-Wayfair-7F187F)](https://wayfair.github.io)
Expand All @@ -10,44 +10,37 @@

Automation workflows for Wayfair's [Open Source Program Office](https://wayfair.github.io).

## Getting Started
## Basic Usage

To get a local copy up and running follow these simple steps.
Currently, the OSPO Automation project has a single workflow available for creating repository forks.

### Prerequisites
To trigger this workflow manually, follow these steps:

This is an example of how to list things you need to use the software and how to install them.
1. Navigate to the [Actions](https://github.com/wayfair/ospo-automation/actions) tab of the project
2. Locate the workflow you wish to run - in this case: **[fork](https://github.com/lelia/ospo-platform/actions/workflows/fork.yml)**
3. Under the run history, you should see: `This workflow has a workflow_dispatch event trigger`
4. Click the `Run workflow` button next to this message, and a dialogue box should open
5. Fill out the required [inputs](https://github.com/wayfair-incubator/forker#inputs) to run the `forker` action
6. Click the green `Run workflow` button at the bottom to manually trigger the workflow
7. Watch your workflow spin into action in the run history!

- npm
## Adding Workflows

```sh
npm install npm@latest -g
```
To add new workflows to the project, follow these simple steps:

### Installation

1. Clone the repo
1. Clone the repository:

```sh
git clone https://github.com/wayfair/ospo-automation.git
```

2. Install NPM packages
2. Create new GitHub workflows under `.github/workflows`:

```sh
npm install
cd .github/workflows
touch my-cool-workflow.yml
```

## Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

_For more examples, please refer to the [Documentation](https://wayfair.github.io) or the [Wiki](https://github.com/wayfair/ospo-automation/wiki)_

## Roadmap

See the [open issues](https://github.com/wayfair/ospo-automation/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. For detailed contributing guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md)
Expand Down

0 comments on commit 3ab01c1

Please sign in to comment.